blob: 835bd6d58087378630479802fe6a354533a8de8f [file] [log] [blame]
[email protected]7e4c33142014-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
[email protected]189add52014-05-28 16:51:445import("//tools/grit/grit_rule.gni")
phosek636bceb32015-10-27 03:36:486import("//build/config/nacl/config.gni")
Scott Violet02e38b92018-03-27 23:42:147import("//ppapi/buildflags/buildflags.gni")
[email protected]189add52014-05-28 16:51:448
9# Applied by targets internal to content.
10config("content_implementation") {
11 defines = [ "CONTENT_IMPLEMENTATION" ]
Dave Tapuskad3f0eaf72018-02-22 21:02:1212 configs = [
13 "//build/config/compiler:wexit_time_destructors",
14 "//build/config/compiler:noshadowing",
15 ]
[email protected]189add52014-05-28 16:51:4416}
17
Brett Wilson8f1323042014-09-11 16:58:5618# When targets depend on, e.g. //content/public/browser, what happens? To
19# facilitate the complexity here, the "public" targets are groups that forward
20# to the right thing depending on the build mode. Say for additional
21# illustration, the public browser sources also depend on the public common
22# ones.
23#
24# The non-component build is easy:
25# foo ->
26# //content/public/browser (group) ->
27# //content/public/browser:browser_sources (source set) ->
28# //content/browser (source set, this is the non-public browser target)
29# //content/public/common:common_sources (source set)
30#
31# The component build is more complicated because we want everybody to depend on
32# one content shared library regardless of which public target they depend on:
33# foo ->
34# //content/public/browser (group) ->
35# //content (shared library) ->
36# //content/public/browser:browser_sources (source set) ->
37# //content/browser (source set; this is the non-public browser target)
38# //content/public/common:common_sources (source set)
39#
40# That the internal content dependencies must depend on the *_sources targets
41# to avoid dependency cycles, and external dependencies must depend on the
42# //content/public/browser and similar targets to avoid double-linking (these
43# targets make sure the dependency goes through the content shared library
44# when doing a component build).
brettwb78fc9e2016-03-25 21:02:5145#
46# TESTS
47# -----
48# Tests are a challenge. The content tests need to access internals of
49# content/browser, for example, but the tests themselves are outside of the
50# content component (which is a shared library in the component build). To
51# prevent external-to-content targets from depending on private headers,
52# the non-public content/browser target is not a public dep of the content
53# component. But this means there is also no public path for the content
54# tests and no way to restrict that just to //content/test/* if we added one.
55#
56# As a result, we check deps for //content/test/* only in non-component builds
57# (which should verify the dependencies are correct for both component and
58# non-component cases equally). There are targets like
59# //content/browser:for_content_tests that allow content/test to depend on the
60# //content/browser target only in non-component builds (when there are no
61# linking problems) for when check is enabled.
Brett Wilson8f1323042014-09-11 16:58:5662
phosek636bceb32015-10-27 03:36:4863if (!is_nacl_nonsfi) {
64 content_shared_components = [
65 "//content/gpu:gpu_sources",
66 "//content/public/browser:browser_sources",
67 "//content/public/child:child_sources",
68 "//content/public/common:common_sources",
mmenkef73a5122017-07-13 23:27:3969 "//content/public/gpu:gpu_sources",
phosek636bceb32015-10-27 03:36:4870 "//content/public/renderer:renderer_sources",
71 "//content/public/utility:utility_sources",
72 ]
[email protected]dab154ee2014-06-13 23:48:5073
phosek636bceb32015-10-27 03:36:4874 if (enable_plugins) {
75 content_shared_components +=
76 [ "//content/ppapi_plugin:ppapi_plugin_sources" ]
77 }
jamesr50081742014-09-09 07:52:2278}
79
[email protected]dab154ee2014-06-13 23:48:5080if (is_component_build) {
agrieve3f532322016-01-05 03:23:1581 component("content") {
scottmg7afc4092014-12-03 19:22:4282 public_deps =
83 content_shared_components + [ "//content/public/app:both_sources" ]
[email protected]dab154ee2014-06-13 23:48:5084 }
phosek636bceb32015-10-27 03:36:4885} else if (is_nacl_nonsfi) {
86 source_set("content") {
87 set_sources_assignment_filter([])
88 sources = [
Tom Sepez903f7f12017-10-26 17:34:0289 "//services/service_manager/sandbox/linux/sandbox_seccomp_bpf_linux.cc",
Tom Sepezc09f5d42017-10-16 19:10:0090 "common/sandbox_init_linux.cc",
phosek636bceb32015-10-27 03:36:4891 "public/common/content_switches.cc",
blundell30c19912016-12-20 13:21:0692 "public/common/content_switches.h",
phosek636bceb32015-10-27 03:36:4893 ]
94 set_sources_assignment_filter(sources_assignment_filter)
phosek636bceb32015-10-27 03:36:4895 deps = [
96 "//base",
Scott Violeta35f9a42018-03-22 22:00:4497 "//media:media_buildflags",
Scott Violet73634e322018-04-04 21:05:0298 "//sandbox:sandbox_buildflags",
brettwd064ace4e2016-07-21 21:38:5399 "//sandbox/linux:sandbox",
Tom Sepez15d4e5202017-09-27 23:59:05100 "//services/service_manager/sandbox",
phosek636bceb32015-10-27 03:36:48101 ]
102 }
[email protected]dab154ee2014-06-13 23:48:50103} else {
104 group("content") {
brettwb7f2c302015-12-08 01:29:21105 public_deps = content_shared_components
[email protected]dab154ee2014-06-13 23:48:50106 }
107}
108
[email protected]189add52014-05-28 16:51:44109grit("resources") {
110 source = "content_resources.grd"
Dirk Prankea3727f92017-07-17 17:30:33111
112 # The .grd contains references to generated files.
113 source_is_generated = true
114
[email protected]b89c53842014-07-23 16:32:32115 outputs = [
116 "grit/content_resources.h",
117 "content_resources.pak",
[email protected]b89c53842014-07-23 16:32:32118 ]
rockot00668f92016-04-07 18:56:23119 grit_flags = [
120 "-E",
rockot0a386b5d92017-01-25 00:14:34121 "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
rockot00668f92016-04-07 18:56:23122 ]
123 deps = [
Nasko Oskov3e19fbd2018-06-13 00:13:29124 "//content/browser/process_internals:mojo_bindings_js",
rockot00668f92016-04-07 18:56:23125 "//content/public/app:browser_manifest",
ben20c7ccfc2016-06-28 02:22:58126 "//content/public/app:gpu_manifest",
rockot73b9848f2017-02-15 18:58:02127 "//content/public/app:packaged_services_manifest",
rockotda9887902016-08-19 20:46:42128 "//content/public/app:plugin_manifest",
rockot00668f92016-04-07 18:56:23129 "//content/public/app:renderer_manifest",
ben141b272f2016-06-28 15:47:35130 "//content/public/app:utility_manifest",
ben7095d1a2016-04-13 06:14:58131 "//services/catalog:manifest",
rockot00668f92016-04-07 18:56:23132 ]
[email protected]189add52014-05-28 16:51:44133}
134
[email protected]dab154ee2014-06-13 23:48:50135# This target exists to "hold" the content_export header so we can do proper
136# inclusion testing of it.
137source_set("export") {
brettwb78fc9e2016-03-25 21:02:51138 # Must only be used inside of content.
brettw9af42622014-09-06 21:21:02139 visibility = [ "//content/*" ]
[email protected]dab154ee2014-06-13 23:48:50140 sources = [
tfarina9568fc62015-07-22 23:35:38141 "common/content_export.h",
[email protected]dab154ee2014-06-13 23:48:50142 ]
143}
dprankedb5527d72015-03-08 04:22:47144
brettw4f56c5982015-05-04 22:12:39145# In the GYP build, this file is listed in several targets. In GN just have
146# those targets depend on this one. This can be depended on for any
147# platform for simplicity, and is a no-op on non-Windows.
pmonette18d3ed32015-10-16 21:06:06148source_set("sandbox_helper_win") {
brettw4f56c5982015-05-04 22:12:39149 if (is_win) {
dprankedb5527d72015-03-08 04:22:47150 sources = [
pmonette18d3ed32015-10-16 21:06:06151 "app/sandbox_helper_win.cc",
152 "public/app/sandbox_helper_win.h",
dprankedb5527d72015-03-08 04:22:47153 ]
Tom Sepez9b460f42017-08-10 19:58:10154
dprankedb5527d72015-03-08 04:22:47155 deps = [
dprankedb5527d72015-03-08 04:22:47156 "//sandbox",
157 ]
158 }
159}