[go: nahoru, domu]

blob: 30537118a1a0822c2a1d05e06ab417aef2e721b7 [file] [log] [blame]
brettw@chromium.org7e4c33142014-05-21 22:01:321# 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
phosek636bceb32015-10-27 03:36:485import("//build/config/nacl/config.gni")
Scott Violet02e38b92018-03-27 23:42:146import("//ppapi/buildflags/buildflags.gni")
Ken Rockotf87b01cf2018-12-26 06:52:267import("//tools/grit/grit_rule.gni")
brettw@chromium.org189add52014-05-28 16:51:448
9# Applied by targets internal to content.
10config("content_implementation") {
11 defines = [ "CONTENT_IMPLEMENTATION" ]
Nico Weberc0356ab2018-09-18 22:32:2112 configs = [
13 "//build/config/compiler:noshadowing",
14 "//build/config/compiler:wexit_time_destructors",
15 ]
brettw@chromium.org189add52014-05-28 16:51:4416}
17
Colin Blundella6a96882019-02-13 09:52:3218assert(!is_ios, "Chromium/iOS shouldn't use anything in //content")
19
Brett Wilson8f1323042014-09-11 16:58:5620# When targets depend on, e.g. //content/public/browser, what happens? To
21# facilitate the complexity here, the "public" targets are groups that forward
22# to the right thing depending on the build mode. Say for additional
23# illustration, the public browser sources also depend on the public common
24# ones.
25#
26# The non-component build is easy:
27# foo ->
28# //content/public/browser (group) ->
29# //content/public/browser:browser_sources (source set) ->
30# //content/browser (source set, this is the non-public browser target)
31# //content/public/common:common_sources (source set)
32#
33# The component build is more complicated because we want everybody to depend on
34# one content shared library regardless of which public target they depend on:
35# foo ->
36# //content/public/browser (group) ->
37# //content (shared library) ->
38# //content/public/browser:browser_sources (source set) ->
39# //content/browser (source set; this is the non-public browser target)
40# //content/public/common:common_sources (source set)
41#
42# That the internal content dependencies must depend on the *_sources targets
43# to avoid dependency cycles, and external dependencies must depend on the
44# //content/public/browser and similar targets to avoid double-linking (these
45# targets make sure the dependency goes through the content shared library
46# when doing a component build).
brettwb78fc9e2016-03-25 21:02:5147#
48# TESTS
49# -----
50# Tests are a challenge. The content tests need to access internals of
51# content/browser, for example, but the tests themselves are outside of the
52# content component (which is a shared library in the component build). To
53# prevent external-to-content targets from depending on private headers,
54# the non-public content/browser target is not a public dep of the content
55# component. But this means there is also no public path for the content
56# tests and no way to restrict that just to //content/test/* if we added one.
57#
58# As a result, we check deps for //content/test/* only in non-component builds
59# (which should verify the dependencies are correct for both component and
60# non-component cases equally). There are targets like
61# //content/browser:for_content_tests that allow content/test to depend on the
62# //content/browser target only in non-component builds (when there are no
63# linking problems) for when check is enabled.
Brett Wilson8f1323042014-09-11 16:58:5664
phosek636bceb32015-10-27 03:36:4865if (!is_nacl_nonsfi) {
66 content_shared_components = [
67 "//content/gpu:gpu_sources",
68 "//content/public/browser:browser_sources",
69 "//content/public/child:child_sources",
70 "//content/public/common:common_sources",
mmenkef73a5122017-07-13 23:27:3971 "//content/public/gpu:gpu_sources",
phosek636bceb32015-10-27 03:36:4872 "//content/public/renderer:renderer_sources",
73 "//content/public/utility:utility_sources",
74 ]
brettw@chromium.orgdab154ee2014-06-13 23:48:5075
phosek636bceb32015-10-27 03:36:4876 if (enable_plugins) {
77 content_shared_components +=
78 [ "//content/ppapi_plugin:ppapi_plugin_sources" ]
79 }
jamesr50081742014-09-09 07:52:2280}
81
brettw@chromium.orgdab154ee2014-06-13 23:48:5082if (is_component_build) {
agrieve3f532322016-01-05 03:23:1583 component("content") {
scottmg7afc4092014-12-03 19:22:4284 public_deps =
Nico Weber73db2f532020-04-21 19:40:1885 content_shared_components + [ "//content/public/app:app_sources" ]
brettw@chromium.orgdab154ee2014-06-13 23:48:5086 }
phosek636bceb32015-10-27 03:36:4887} else if (is_nacl_nonsfi) {
88 source_set("content") {
phosek636bceb32015-10-27 03:36:4889 sources = [
Robert Sesek7d0b49b2020-07-08 18:31:2790 "//sandbox/policy/linux/sandbox_seccomp_bpf_linux.cc",
Tom Sepezc09f5d42017-10-16 19:10:0091 "common/sandbox_init_linux.cc",
Robert Sesek8621aef02020-06-25 18:17:3792 "common/zygote/send_zygote_child_ping_linux.cc",
phosek636bceb32015-10-27 03:36:4893 "public/common/content_switches.cc",
blundell30c19912016-12-20 13:21:0694 "public/common/content_switches.h",
phosek636bceb32015-10-27 03:36:4895 ]
phosek636bceb32015-10-27 03:36:4896 deps = [
97 "//base",
Yuta Hijikata4d462022020-11-12 10:55:0498 "//build:chromeos_buildflags",
Scott Violeta35f9a42018-03-22 22:00:4499 "//media:media_buildflags",
Scott Violet73634e322018-04-04 21:05:02100 "//sandbox:sandbox_buildflags",
brettwd064ace4e2016-07-21 21:38:53101 "//sandbox/linux:sandbox",
Robert Sesek7d0b49b2020-07-08 18:31:27102 "//sandbox/policy",
phosek636bceb32015-10-27 03:36:48103 ]
104 }
brettw@chromium.orgdab154ee2014-06-13 23:48:50105} else {
106 group("content") {
brettwb7f2c302015-12-08 01:29:21107 public_deps = content_shared_components
brettw@chromium.orgdab154ee2014-06-13 23:48:50108 }
109}
110
Samuel Huangd0b0e062020-01-20 06:32:12111grit("content_resources") {
brettw@chromium.org189add52014-05-28 16:51:44112 source = "content_resources.grd"
Dirk Prankea3727f92017-07-17 17:30:33113
brettw@chromium.orgb89c53842014-07-23 16:32:32114 outputs = [
115 "grit/content_resources.h",
Kyle Horimotoa69ab462019-04-23 00:08:21116 "grit/content_resources_map.cc",
117 "grit/content_resources_map.h",
brettw@chromium.orgb89c53842014-07-23 16:32:32118 "content_resources.pak",
brettw@chromium.orgb89c53842014-07-23 16:32:32119 ]
rockot00668f92016-04-07 18:56:23120 deps = [
Ken Rockot4acce462020-12-01 01:06:00121 "//gpu/ipc/common:vulkan_interface_webui_js",
Mounir Lamouri32f95a02019-04-26 22:35:37122 "//url/mojom:url_mojom_origin_js",
Ken Rockot4acce462020-12-01 01:06:00123 "//url/mojom:url_mojom_origin_webui_js",
rockot00668f92016-04-07 18:56:23124 ]
brettw@chromium.org189add52014-05-28 16:51:44125}
126
Samuel Huangd0b0e062020-01-20 06:32:12127grit("dev_ui_content_resources") {
128 source = "dev_ui_content_resources.grd"
129
Samuel Huangd0b0e062020-01-20 06:32:12130 outputs = [
131 "grit/dev_ui_content_resources.h",
132 "dev_ui_content_resources.pak",
133 ]
John Delaney99492f42020-05-05 18:41:22134 deps = [
Ken Rockot4acce462020-12-01 01:06:00135 "//content/browser/conversions:mojo_bindings_webui_js",
136 "//content/browser/process_internals:mojo_bindings_webui_js",
John Delaney99492f42020-05-05 18:41:22137 ]
Samuel Huangd0b0e062020-01-20 06:32:12138}
139
brettw@chromium.orgdab154ee2014-06-13 23:48:50140# This target exists to "hold" the content_export header so we can do proper
141# inclusion testing of it.
142source_set("export") {
brettwb78fc9e2016-03-25 21:02:51143 # Must only be used inside of content.
brettw9af42622014-09-06 21:21:02144 visibility = [ "//content/*" ]
Nico Weberc18a0db2020-01-14 09:47:59145 sources = [ "common/content_export.h" ]
brettw@chromium.orgdab154ee2014-06-13 23:48:50146}
dprankedb5527d72015-03-08 04:22:47147
brettw4f56c5982015-05-04 22:12:39148# In the GYP build, this file is listed in several targets. In GN just have
149# those targets depend on this one. This can be depended on for any
150# platform for simplicity, and is a no-op on non-Windows.
pmonette18d3ed32015-10-16 21:06:06151source_set("sandbox_helper_win") {
brettw4f56c5982015-05-04 22:12:39152 if (is_win) {
dprankedb5527d72015-03-08 04:22:47153 sources = [
pmonette18d3ed32015-10-16 21:06:06154 "app/sandbox_helper_win.cc",
155 "public/app/sandbox_helper_win.h",
dprankedb5527d72015-03-08 04:22:47156 ]
Tom Sepez9b460f42017-08-10 19:58:10157
Nico Weberc18a0db2020-01-14 09:47:59158 deps = [ "//sandbox" ]
dprankedb5527d72015-03-08 04:22:47159 }
160}