[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 1 | # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Azeem Arshad | 8282d3d | 2020-12-03 17:45:48 | [diff] [blame] | 5 | import("//build/config/chromeos/ui_mode.gni") |
[email protected] | 22fe91d | 2014-08-12 17:07:12 | [diff] [blame] | 6 | import("//build/config/ui.gni") |
qyearsley | db0a3487 | 2017-03-14 03:24:31 | [diff] [blame] | 7 | import("//gpu/vulkan/features.gni") |
xhwang | fb22df1 | 2015-10-13 23:13:46 | [diff] [blame] | 8 | import("//media/media_options.gni") |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 9 | |
sammc | d06e3fc | 2015-04-28 00:14:54 | [diff] [blame] | 10 | # See //content/BUILD.gn for how this works. |
| 11 | group("gpu") { |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 12 | visibility = [ "//content/*" ] # This is an internal content API. |
sammc | d06e3fc | 2015-04-28 00:14:54 | [diff] [blame] | 13 | |
| 14 | if (is_component_build) { |
Nico Weber | 0caa298 | 2020-01-14 16:00:43 | [diff] [blame] | 15 | public_deps = [ "//content" ] |
sammc | d06e3fc | 2015-04-28 00:14:54 | [diff] [blame] | 16 | } else { |
Nico Weber | 0caa298 | 2020-01-14 16:00:43 | [diff] [blame] | 17 | public_deps = [ ":gpu_sources" ] |
sammc | d06e3fc | 2015-04-28 00:14:54 | [diff] [blame] | 18 | } |
| 19 | } |
| 20 | |
brucedawson | 6e53a2e1 | 2016-07-23 19:35:47 | [diff] [blame] | 21 | if (is_component_build) { |
Dirk Pranke | 9c0fc3b | 2020-08-06 16:01:30 | [diff] [blame] | 22 | link_target_type = "source_set" |
brucedawson | 6e53a2e1 | 2016-07-23 19:35:47 | [diff] [blame] | 23 | } else { |
Dirk Pranke | 9c0fc3b | 2020-08-06 16:01:30 | [diff] [blame] | 24 | link_target_type = "static_library" |
brucedawson | 6e53a2e1 | 2016-07-23 19:35:47 | [diff] [blame] | 25 | } |
Tom Sepez | 085507ab | 2017-10-18 22:36:00 | [diff] [blame] | 26 | |
brucedawson | 6e53a2e1 | 2016-07-23 19:35:47 | [diff] [blame] | 27 | target(link_target_type, "gpu_sources") { |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 28 | # This is an internal content API. Code outside of the content "component" |
| 29 | # (like content/test and content/shell) should depend on ":gpu" above. |
Brett Wilson | 8f132304 | 2014-09-11 16:58:56 | [diff] [blame] | 30 | visibility = [ "//content/*" ] |
[email protected] | 6294f0d | 2014-08-20 17:43:09 | [diff] [blame] | 31 | |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 32 | sources = [ |
Ken Rockot | 6d9ed9503 | 2019-11-13 17:20:47 | [diff] [blame] | 33 | "browser_exposed_gpu_interfaces.cc", |
| 34 | "browser_exposed_gpu_interfaces.h", |
satorux | 7fa9d30 | 2015-02-16 00:44:52 | [diff] [blame] | 35 | "gpu_child_thread.cc", |
| 36 | "gpu_child_thread.h", |
Robert Sesek | 4fed6f1 | 2019-10-15 23:31:01 | [diff] [blame] | 37 | "gpu_child_thread_receiver_bindings.cc", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 38 | "gpu_main.cc", |
| 39 | "gpu_process.cc", |
| 40 | "gpu_process.h", |
ben | 507aa81 | 2016-08-10 23:26:19 | [diff] [blame] | 41 | "gpu_service_factory.cc", |
| 42 | "gpu_service_factory.h", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 43 | "in_process_gpu_thread.cc", |
| 44 | "in_process_gpu_thread.h", |
| 45 | ] |
| 46 | |
ben | 02a3777 | 2015-11-19 04:37:05 | [diff] [blame] | 47 | configs += [ "//content:content_implementation" ] |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 48 | |
| 49 | deps = [ |
| 50 | "//base", |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 51 | "//base/third_party/dynamic_annotations", |
Azeem Arshad | 8282d3d | 2020-12-03 17:45:48 | [diff] [blame] | 52 | "//build:branding_buildflags", |
| 53 | "//build:chromeos_buildflags", |
Fady Samuel | 279f5f0 | 2017-06-14 23:23:00 | [diff] [blame] | 54 | "//components/viz/service", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 55 | "//content:export", |
brettw | db08710 | 2016-04-18 21:33:08 | [diff] [blame] | 56 | "//content/child", |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 57 | "//content/common", |
chiniforooshan | 701fa21 | 2017-04-06 22:22:49 | [diff] [blame] | 58 | "//content/common:mojo_bindings", |
blundell | 24ab5d36 | 2014-11-21 10:11:19 | [diff] [blame] | 59 | "//content/public/child:child_sources", |
fsamuel | 68efb48 | 2016-03-17 12:15:43 | [diff] [blame] | 60 | "//content/public/common:common_sources", |
markdittmer | cbf36ce | 2016-03-02 16:08:29 | [diff] [blame] | 61 | "//gpu:gpu", |
fsamuel | 19acfae | 2016-03-22 05:38:24 | [diff] [blame] | 62 | "//gpu/ipc/common:command_buffer_traits", |
markdittmer | d88b835 | 2016-04-08 15:28:45 | [diff] [blame] | 63 | "//gpu/ipc/service", |
fsamuel | 68efb48 | 2016-03-17 12:15:43 | [diff] [blame] | 64 | "//ipc", |
Scott Violet | a35f9a4 | 2018-03-22 22:00:44 | [diff] [blame] | 65 | "//media:media_buildflags", |
markdittmer | 6e70beb8 | 2016-05-02 05:40:47 | [diff] [blame] | 66 | "//media/gpu", |
Scott Violet | a35f9a4 | 2018-03-22 22:00:44 | [diff] [blame] | 67 | "//media/mojo:buildflags", |
jrummell | 397905b | 2017-03-20 22:36:25 | [diff] [blame] | 68 | |
| 69 | # TODO(jrummell): As //media/gpu/ipc/service is a source_set in a |
| 70 | # component build, determine if it should not be included here. |
| 71 | # http://crbug.com/702833. |
Sadrul Habib Chowdhury | 55fc2f0 | 2017-10-27 02:40:06 | [diff] [blame] | 72 | "//components/viz/service/main", |
markdittmer | 6e70beb8 | 2016-05-02 05:40:47 | [diff] [blame] | 73 | "//media/gpu/ipc/service", |
liberato | 441ca70 | 2017-05-13 16:50:38 | [diff] [blame] | 74 | "//media/mojo/clients:clients", |
Will Harris | 0310c11 | 2020-07-16 02:29:35 | [diff] [blame] | 75 | "//sandbox/policy:chromecast_sandbox_allowlist_buildflags", |
rockot | 734fb66 | 2016-10-15 16:41:30 | [diff] [blame] | 76 | "//services/service_manager/public/cpp", |
Ken Rockot | 543f5e3 | 2018-02-04 02:13:50 | [diff] [blame] | 77 | "//services/service_manager/public/mojom", |
Oystein Eftevaag | 424fd37 | 2019-06-07 17:51:03 | [diff] [blame] | 78 | "//services/tracing/public/cpp", |
Miyoung Shin | 2be27f5 | 2019-07-27 15:35:39 | [diff] [blame] | 79 | "//services/viz/privileged/mojom", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 80 | "//skia", |
Tom Sepez | a0950c6 | 2017-10-18 20:39:14 | [diff] [blame] | 81 | "//third_party/angle:angle_gpu_info_util", |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 82 | "//ui/gfx/ipc", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 83 | "//ui/gl", |
kylechar | 5b9dec1 | 2016-05-16 15:40:57 | [diff] [blame] | 84 | "//ui/gl/init", |
mfomitchev | 3ba450ad | 2017-04-03 18:20:40 | [diff] [blame] | 85 | "//ui/latency/ipc", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 86 | ] |
| 87 | |
Yuta Hijikata | 45cd707 | 2021-01-13 05:38:22 | [diff] [blame] | 88 | if (!is_chromeos_ash || !is_chrome_branded) { |
Azeem Arshad | 8282d3d | 2020-12-03 17:45:48 | [diff] [blame] | 89 | deps += [ |
| 90 | "//services/shape_detection:lib", |
| 91 | "//services/shape_detection/public/mojom", |
| 92 | ] |
| 93 | } |
| 94 | |
Sylvain Defresne | 618ffb05 | 2020-10-05 11:25:52 | [diff] [blame] | 95 | if (is_linux || is_chromeos) { |
| 96 | sources += [ |
| 97 | "gpu_sandbox_hook_linux.cc", |
| 98 | "gpu_sandbox_hook_linux.h", |
| 99 | ] |
| 100 | } |
| 101 | |
Eric Sum | c8607e7 | 2022-02-18 00:48:03 | [diff] [blame^] | 102 | if (is_chromeos_ash) { |
| 103 | deps += [ |
| 104 | "//components/services/font/public/cpp", |
| 105 | "//components/services/font/public/mojom", |
| 106 | ] |
| 107 | } |
| 108 | |
xhwang | ded3b6e | 2016-05-25 05:24:51 | [diff] [blame] | 109 | if (is_android) { |
ssid | 75819d9 | 2020-03-04 21:12:35 | [diff] [blame] | 110 | deps += [ |
| 111 | "//components/tracing:graphics_provider", |
| 112 | "//media", |
| 113 | ] |
xhwang | ded3b6e | 2016-05-25 05:24:51 | [diff] [blame] | 114 | } |
| 115 | |
xhwang | be72003 | 2016-02-19 18:45:31 | [diff] [blame] | 116 | if (mojo_media_host == "gpu") { |
xhwang | d3b5d3f | 2016-05-18 03:37:59 | [diff] [blame] | 117 | deps += [ "//media/mojo/services" ] |
xhwang | fb22df1 | 2015-10-13 23:13:46 | [diff] [blame] | 118 | } |
| 119 | |
Sean McAllister | 8ccdb764 | 2020-07-30 20:05:52 | [diff] [blame] | 120 | if (is_linux || is_chromeos || is_mac || is_win) { |
Bill Budge | 2ca3514 | 2018-02-21 23:22:22 | [diff] [blame] | 121 | deps += [ "//sandbox" ] |
| 122 | } |
| 123 | |
Christopher Cameron | 21c4abc | 2019-11-15 04:06:15 | [diff] [blame] | 124 | if (is_mac) { |
| 125 | deps += [ "//components/metal_util" ] |
| 126 | } |
| 127 | |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 128 | if (use_ozone) { |
| 129 | deps += [ "//ui/ozone" ] |
| 130 | } |
| 131 | |
dyen | 2ce3e05 | 2016-03-09 21:03:49 | [diff] [blame] | 132 | if (enable_vulkan) { |
| 133 | deps += [ "//gpu/vulkan" ] |
| 134 | } |
Julien Isorce | b662350 | 2017-11-28 12:20:40 | [diff] [blame] | 135 | |
Stephen Lanham | 28a49d5 | 2017-11-30 01:53:37 | [diff] [blame] | 136 | # Use DRI on desktop Linux builds. |
Hidehiko Abe | 28834ce | 2021-06-16 07:01:40 | [diff] [blame] | 137 | if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux && |
Junliang Yan | 15ac173 | 2018-02-02 02:25:44 | [diff] [blame] | 138 | (!is_chromecast || is_cast_desktop_build)) { |
Julien Isorce | b662350 | 2017-11-28 12:20:40 | [diff] [blame] | 139 | configs += [ "//build/config/linux/dri" ] |
| 140 | } |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 141 | } |