blob: c6a90abae4360ad73c608b6650b9d8b7216ea933 [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501# Copyright 2014 The Chromium Authors
[email protected]dab154ee2014-06-13 23:48:502# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
mark a. foltze185ab2fa2023-11-06 21:21:205import("//build/config/cast.gni")
[email protected]22fe91d2014-08-12 17:07:126import("//build/config/ui.gni")
qyearsleydb0a34872017-03-14 03:24:317import("//gpu/vulkan/features.gni")
xhwangfb22df12015-10-13 23:13:468import("//media/media_options.gni")
[email protected]dab154ee2014-06-13 23:48:509
sammcd06e3fc2015-04-28 00:14:5410# See //content/BUILD.gn for how this works.
11group("gpu") {
brettwb78fc9e2016-03-25 21:02:5112 visibility = [ "//content/*" ] # This is an internal content API.
sammcd06e3fc2015-04-28 00:14:5413
14 if (is_component_build) {
Nico Weber0caa2982020-01-14 16:00:4315 public_deps = [ "//content" ]
sammcd06e3fc2015-04-28 00:14:5416 } else {
Nico Weber0caa2982020-01-14 16:00:4317 public_deps = [ ":gpu_sources" ]
sammcd06e3fc2015-04-28 00:14:5418 }
19}
20
brucedawson6e53a2e12016-07-23 19:35:4721if (is_component_build) {
Dirk Pranke9c0fc3b2020-08-06 16:01:3022 link_target_type = "source_set"
brucedawson6e53a2e12016-07-23 19:35:4723} else {
Dirk Pranke9c0fc3b2020-08-06 16:01:3024 link_target_type = "static_library"
brucedawson6e53a2e12016-07-23 19:35:4725}
Tom Sepez085507ab2017-10-18 22:36:0026
brucedawson6e53a2e12016-07-23 19:35:4727target(link_target_type, "gpu_sources") {
brettwb78fc9e2016-03-25 21:02:5128 # 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 Wilson8f1323042014-09-11 16:58:5630 visibility = [ "//content/*" ]
[email protected]6294f0d2014-08-20 17:43:0931
[email protected]dab154ee2014-06-13 23:48:5032 sources = [
Ken Rockot6d9ed95032019-11-13 17:20:4733 "browser_exposed_gpu_interfaces.cc",
34 "browser_exposed_gpu_interfaces.h",
satorux7fa9d302015-02-16 00:44:5235 "gpu_child_thread.cc",
36 "gpu_child_thread.h",
Robert Sesek4fed6f12019-10-15 23:31:0137 "gpu_child_thread_receiver_bindings.cc",
[email protected]dab154ee2014-06-13 23:48:5038 "gpu_main.cc",
ben507aa812016-08-10 23:26:1939 "gpu_service_factory.cc",
40 "gpu_service_factory.h",
[email protected]dab154ee2014-06-13 23:48:5041 "in_process_gpu_thread.cc",
42 "in_process_gpu_thread.h",
43 ]
44
ben02a37772015-11-19 04:37:0545 configs += [ "//content:content_implementation" ]
[email protected]dab154ee2014-06-13 23:48:5046
47 deps = [
48 "//base",
Azeem Arshad8282d3d2020-12-03 17:45:4849 "//build:branding_buildflags",
Fady Samuel279f5f02017-06-14 23:23:0050 "//components/viz/service",
[email protected]dab154ee2014-06-13 23:48:5051 "//content:export",
brettwdb087102016-04-18 21:33:0852 "//content/child",
brettwb78fc9e2016-03-25 21:02:5153 "//content/common",
chiniforooshan701fa212017-04-06 22:22:4954 "//content/common:mojo_bindings",
blundell24ab5d362014-11-21 10:11:1955 "//content/public/child:child_sources",
fsamuel68efb482016-03-17 12:15:4356 "//content/public/common:common_sources",
markdittmercbf36ce2016-03-02 16:08:2957 "//gpu:gpu",
fsamuel19acfae2016-03-22 05:38:2458 "//gpu/ipc/common:command_buffer_traits",
markdittmerd88b8352016-04-08 15:28:4559 "//gpu/ipc/service",
fsamuel68efb482016-03-17 12:15:4360 "//ipc",
Scott Violeta35f9a42018-03-22 22:00:4461 "//media:media_buildflags",
markdittmer6e70beb82016-05-02 05:40:4762 "//media/gpu",
Scott Violeta35f9a42018-03-22 22:00:4463 "//media/mojo:buildflags",
jrummell397905b2017-03-20 22:36:2564
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 Chowdhury55fc2f02017-10-27 02:40:0668 "//components/viz/service/main",
markdittmer6e70beb82016-05-02 05:40:4769 "//media/gpu/ipc/service",
liberato441ca702017-05-13 16:50:3870 "//media/mojo/clients:clients",
Will Harris0310c112020-07-16 02:29:3571 "//sandbox/policy:chromecast_sandbox_allowlist_buildflags",
rockot734fb662016-10-15 16:41:3072 "//services/service_manager/public/cpp",
Ken Rockot543f5e32018-02-04 02:13:5073 "//services/service_manager/public/mojom",
Oystein Eftevaag424fd372019-06-07 17:51:0374 "//services/tracing/public/cpp",
Miyoung Shin2be27f52019-07-27 15:35:3975 "//services/viz/privileged/mojom",
[email protected]dab154ee2014-06-13 23:48:5076 "//skia",
Tom Sepeza0950c62017-10-18 20:39:1477 "//third_party/angle:angle_gpu_info_util",
brettwb78fc9e2016-03-25 21:02:5178 "//ui/gfx/ipc",
[email protected]dab154ee2014-06-13 23:48:5079 "//ui/gl",
kylechar5b9dec12016-05-16 15:40:5780 "//ui/gl/init",
mfomitchev3ba450ad2017-04-03 18:20:4081 "//ui/latency/ipc",
[email protected]dab154ee2014-06-13 23:48:5082 ]
83
Georg Neis18fc5142024-12-18 00:58:4184 if (!is_chromeos || !is_chrome_branded) {
Azeem Arshad8282d3d2020-12-03 17:45:4885 deps += [
86 "//services/shape_detection:lib",
87 "//services/shape_detection/public/mojom",
88 ]
89 }
90
Georg Neis18fc5142024-12-18 00:58:4191 if (is_chromeos) {
Eric Sumc8607e72022-02-18 00:48:0392 deps += [
93 "//components/services/font/public/cpp",
94 "//components/services/font/public/mojom",
95 ]
96 }
97
xhwangded3b6e2016-05-25 05:24:5198 if (is_android) {
ssid75819d92020-03-04 21:12:3599 deps += [
100 "//components/tracing:graphics_provider",
101 "//media",
Ben Scarlato5ece30c72025-05-09 22:13:20102 "//sandbox/linux:sandbox_services",
ssid75819d92020-03-04 21:12:35103 ]
xhwangded3b6e2016-05-25 05:24:51104 }
105
xhwangbe720032016-02-19 18:45:31106 if (mojo_media_host == "gpu") {
xhwangd3b5d3f2016-05-18 03:37:59107 deps += [ "//media/mojo/services" ]
xhwangfb22df12015-10-13 23:13:46108 }
109
Sean McAllister8ccdb7642020-07-30 20:05:52110 if (is_linux || is_chromeos || is_mac || is_win) {
Bill Budge2ca35142018-02-21 23:22:22111 deps += [ "//sandbox" ]
112 }
113
Christopher Cameron21c4abc2019-11-15 04:06:15114 if (is_mac) {
115 deps += [ "//components/metal_util" ]
116 }
117
brettwb78fc9e2016-03-25 21:02:51118 if (use_ozone) {
119 deps += [ "//ui/ozone" ]
120 }
121
dyen2ce3e052016-03-09 21:03:49122 if (enable_vulkan) {
123 deps += [ "//gpu/vulkan" ]
124 }
Julien Isorceb6623502017-11-28 12:20:40125
Stephen Lanham28a49d52017-11-30 01:53:37126 # Use DRI on desktop Linux builds.
Hidehiko Abe28834ce2021-06-16 07:01:40127 if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux &&
Ryan Keaneaf3ac0f2022-05-02 18:40:08128 !is_castos) {
Julien Isorceb6623502017-11-28 12:20:40129 configs += [ "//build/config/linux/dri" ]
130 }
[email protected]dab154ee2014-06-13 23:48:50131}