Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | # Copyright 2014 The Chromium Authors |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
mark a. foltz | e185ab2fa | 2023-11-06 21:21:20 | [diff] [blame] | 5 | import("//build/config/cast.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", |
ben | 507aa81 | 2016-08-10 23:26:19 | [diff] [blame] | 39 | "gpu_service_factory.cc", |
| 40 | "gpu_service_factory.h", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 41 | "in_process_gpu_thread.cc", |
| 42 | "in_process_gpu_thread.h", |
| 43 | ] |
| 44 | |
ben | 02a3777 | 2015-11-19 04:37:05 | [diff] [blame] | 45 | configs += [ "//content:content_implementation" ] |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 46 | |
| 47 | deps = [ |
| 48 | "//base", |
Azeem Arshad | 8282d3d | 2020-12-03 17:45:48 | [diff] [blame] | 49 | "//build:branding_buildflags", |
Fady Samuel | 279f5f0 | 2017-06-14 23:23:00 | [diff] [blame] | 50 | "//components/viz/service", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 51 | "//content:export", |
brettw | db08710 | 2016-04-18 21:33:08 | [diff] [blame] | 52 | "//content/child", |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 53 | "//content/common", |
chiniforooshan | 701fa21 | 2017-04-06 22:22:49 | [diff] [blame] | 54 | "//content/common:mojo_bindings", |
blundell | 24ab5d36 | 2014-11-21 10:11:19 | [diff] [blame] | 55 | "//content/public/child:child_sources", |
fsamuel | 68efb48 | 2016-03-17 12:15:43 | [diff] [blame] | 56 | "//content/public/common:common_sources", |
markdittmer | cbf36ce | 2016-03-02 16:08:29 | [diff] [blame] | 57 | "//gpu:gpu", |
fsamuel | 19acfae | 2016-03-22 05:38:24 | [diff] [blame] | 58 | "//gpu/ipc/common:command_buffer_traits", |
markdittmer | d88b835 | 2016-04-08 15:28:45 | [diff] [blame] | 59 | "//gpu/ipc/service", |
fsamuel | 68efb48 | 2016-03-17 12:15:43 | [diff] [blame] | 60 | "//ipc", |
Scott Violet | a35f9a4 | 2018-03-22 22:00:44 | [diff] [blame] | 61 | "//media:media_buildflags", |
markdittmer | 6e70beb8 | 2016-05-02 05:40:47 | [diff] [blame] | 62 | "//media/gpu", |
Scott Violet | a35f9a4 | 2018-03-22 22:00:44 | [diff] [blame] | 63 | "//media/mojo:buildflags", |
jrummell | 397905b | 2017-03-20 22:36:25 | [diff] [blame] | 64 | |
| 65 | # TODO(jrummell): As //media/gpu/ipc/service is a source_set in a |
| 66 | # component build, determine if it should not be included here. |
| 67 | # http://crbug.com/702833. |
Sadrul Habib Chowdhury | 55fc2f0 | 2017-10-27 02:40:06 | [diff] [blame] | 68 | "//components/viz/service/main", |
markdittmer | 6e70beb8 | 2016-05-02 05:40:47 | [diff] [blame] | 69 | "//media/gpu/ipc/service", |
liberato | 441ca70 | 2017-05-13 16:50:38 | [diff] [blame] | 70 | "//media/mojo/clients:clients", |
Will Harris | 0310c11 | 2020-07-16 02:29:35 | [diff] [blame] | 71 | "//sandbox/policy:chromecast_sandbox_allowlist_buildflags", |
rockot | 734fb66 | 2016-10-15 16:41:30 | [diff] [blame] | 72 | "//services/service_manager/public/cpp", |
Ken Rockot | 543f5e3 | 2018-02-04 02:13:50 | [diff] [blame] | 73 | "//services/service_manager/public/mojom", |
Oystein Eftevaag | 424fd37 | 2019-06-07 17:51:03 | [diff] [blame] | 74 | "//services/tracing/public/cpp", |
Miyoung Shin | 2be27f5 | 2019-07-27 15:35:39 | [diff] [blame] | 75 | "//services/viz/privileged/mojom", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 76 | "//skia", |
Tom Sepez | a0950c6 | 2017-10-18 20:39:14 | [diff] [blame] | 77 | "//third_party/angle:angle_gpu_info_util", |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 78 | "//ui/gfx/ipc", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 79 | "//ui/gl", |
kylechar | 5b9dec1 | 2016-05-16 15:40:57 | [diff] [blame] | 80 | "//ui/gl/init", |
mfomitchev | 3ba450ad | 2017-04-03 18:20:40 | [diff] [blame] | 81 | "//ui/latency/ipc", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 82 | ] |
| 83 | |
Georg Neis | 18fc514 | 2024-12-18 00:58:41 | [diff] [blame] | 84 | if (!is_chromeos || !is_chrome_branded) { |
Azeem Arshad | 8282d3d | 2020-12-03 17:45:48 | [diff] [blame] | 85 | deps += [ |
| 86 | "//services/shape_detection:lib", |
| 87 | "//services/shape_detection/public/mojom", |
| 88 | ] |
| 89 | } |
| 90 | |
Georg Neis | 18fc514 | 2024-12-18 00:58:41 | [diff] [blame] | 91 | if (is_chromeos) { |
Eric Sum | c8607e7 | 2022-02-18 00:48:03 | [diff] [blame] | 92 | deps += [ |
| 93 | "//components/services/font/public/cpp", |
| 94 | "//components/services/font/public/mojom", |
| 95 | ] |
| 96 | } |
| 97 | |
xhwang | ded3b6e | 2016-05-25 05:24:51 | [diff] [blame] | 98 | if (is_android) { |
ssid | 75819d9 | 2020-03-04 21:12:35 | [diff] [blame] | 99 | deps += [ |
| 100 | "//components/tracing:graphics_provider", |
| 101 | "//media", |
Ben Scarlato | 5ece30c7 | 2025-05-09 22:13:20 | [diff] [blame] | 102 | "//sandbox/linux:sandbox_services", |
ssid | 75819d9 | 2020-03-04 21:12:35 | [diff] [blame] | 103 | ] |
xhwang | ded3b6e | 2016-05-25 05:24:51 | [diff] [blame] | 104 | } |
| 105 | |
xhwang | be72003 | 2016-02-19 18:45:31 | [diff] [blame] | 106 | if (mojo_media_host == "gpu") { |
xhwang | d3b5d3f | 2016-05-18 03:37:59 | [diff] [blame] | 107 | deps += [ "//media/mojo/services" ] |
xhwang | fb22df1 | 2015-10-13 23:13:46 | [diff] [blame] | 108 | } |
| 109 | |
Sean McAllister | 8ccdb764 | 2020-07-30 20:05:52 | [diff] [blame] | 110 | if (is_linux || is_chromeos || is_mac || is_win) { |
Bill Budge | 2ca3514 | 2018-02-21 23:22:22 | [diff] [blame] | 111 | deps += [ "//sandbox" ] |
| 112 | } |
| 113 | |
Christopher Cameron | 21c4abc | 2019-11-15 04:06:15 | [diff] [blame] | 114 | if (is_mac) { |
| 115 | deps += [ "//components/metal_util" ] |
| 116 | } |
| 117 | |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 118 | if (use_ozone) { |
| 119 | deps += [ "//ui/ozone" ] |
| 120 | } |
| 121 | |
dyen | 2ce3e05 | 2016-03-09 21:03:49 | [diff] [blame] | 122 | if (enable_vulkan) { |
| 123 | deps += [ "//gpu/vulkan" ] |
| 124 | } |
Julien Isorce | b662350 | 2017-11-28 12:20:40 | [diff] [blame] | 125 | |
Stephen Lanham | 28a49d5 | 2017-11-30 01:53:37 | [diff] [blame] | 126 | # Use DRI on desktop Linux builds. |
Hidehiko Abe | 28834ce | 2021-06-16 07:01:40 | [diff] [blame] | 127 | if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux && |
Ryan Keane | af3ac0f | 2022-05-02 18:40:08 | [diff] [blame] | 128 | !is_castos) { |
Julien Isorce | b662350 | 2017-11-28 12:20:40 | [diff] [blame] | 129 | configs += [ "//build/config/linux/dri" ] |
| 130 | } |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 131 | } |