blob: bbeec560a982d2bf17f21775bce59a43ed46d0d5 [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")
[email protected]189add52014-05-28 16:51:447
8# Applied by targets internal to content.
9config("content_implementation") {
10 defines = [ "CONTENT_IMPLEMENTATION" ]
rsesek99679aa2016-06-28 21:24:1711 configs = [ "//build/config/compiler:wexit_time_destructors" ]
[email protected]189add52014-05-28 16:51:4412}
13
Brett Wilson8f1323042014-09-11 16:58:5614# When targets depend on, e.g. //content/public/browser, what happens? To
15# facilitate the complexity here, the "public" targets are groups that forward
16# to the right thing depending on the build mode. Say for additional
17# illustration, the public browser sources also depend on the public common
18# ones.
19#
20# The non-component build is easy:
21# foo ->
22# //content/public/browser (group) ->
23# //content/public/browser:browser_sources (source set) ->
24# //content/browser (source set, this is the non-public browser target)
25# //content/public/common:common_sources (source set)
26#
27# The component build is more complicated because we want everybody to depend on
28# one content shared library regardless of which public target they depend on:
29# foo ->
30# //content/public/browser (group) ->
31# //content (shared library) ->
32# //content/public/browser:browser_sources (source set) ->
33# //content/browser (source set; this is the non-public browser target)
34# //content/public/common:common_sources (source set)
35#
36# That the internal content dependencies must depend on the *_sources targets
37# to avoid dependency cycles, and external dependencies must depend on the
38# //content/public/browser and similar targets to avoid double-linking (these
39# targets make sure the dependency goes through the content shared library
40# when doing a component build).
brettwb78fc9e2016-03-25 21:02:5141#
42# TESTS
43# -----
44# Tests are a challenge. The content tests need to access internals of
45# content/browser, for example, but the tests themselves are outside of the
46# content component (which is a shared library in the component build). To
47# prevent external-to-content targets from depending on private headers,
48# the non-public content/browser target is not a public dep of the content
49# component. But this means there is also no public path for the content
50# tests and no way to restrict that just to //content/test/* if we added one.
51#
52# As a result, we check deps for //content/test/* only in non-component builds
53# (which should verify the dependencies are correct for both component and
54# non-component cases equally). There are targets like
55# //content/browser:for_content_tests that allow content/test to depend on the
56# //content/browser target only in non-component builds (when there are no
57# linking problems) for when check is enabled.
Brett Wilson8f1323042014-09-11 16:58:5658
phosek636bceb32015-10-27 03:36:4859if (!is_nacl_nonsfi) {
60 content_shared_components = [
61 "//content/gpu:gpu_sources",
62 "//content/public/browser:browser_sources",
63 "//content/public/child:child_sources",
kcwu08377ad2016-02-18 19:12:4264 "//content/public/gpu:gpu_sources",
phosek636bceb32015-10-27 03:36:4865 "//content/public/common:common_sources",
phosek636bceb32015-10-27 03:36:4866 "//content/public/renderer:renderer_sources",
67 "//content/public/utility:utility_sources",
68 ]
[email protected]dab154ee2014-06-13 23:48:5069
phosek636bceb32015-10-27 03:36:4870 if (enable_plugins) {
71 content_shared_components +=
72 [ "//content/ppapi_plugin:ppapi_plugin_sources" ]
73 }
jamesr50081742014-09-09 07:52:2274}
75
[email protected]dab154ee2014-06-13 23:48:5076if (is_component_build) {
agrieve3f532322016-01-05 03:23:1577 component("content") {
scottmg7afc4092014-12-03 19:22:4278 public_deps =
79 content_shared_components + [ "//content/public/app:both_sources" ]
brettwba7a73d2015-08-31 22:17:3980 deps = [
81 "//build/config/sanitizers:deps",
82 ]
[email protected]dab154ee2014-06-13 23:48:5083 }
phosek636bceb32015-10-27 03:36:4884} else if (is_nacl_nonsfi) {
85 source_set("content") {
86 set_sources_assignment_filter([])
87 sources = [
88 "common/sandbox_linux/sandbox_init_linux.cc",
89 "common/sandbox_linux/sandbox_seccomp_bpf_linux.cc",
90 "common/send_zygote_child_ping_linux.cc",
91 "public/common/content_switches.cc",
92 ]
93 set_sources_assignment_filter(sources_assignment_filter)
94
95 defines = [ "USE_SECCOMP_BPF=1" ]
96
97 deps = [
98 "//base",
brettwd064ace4e2016-07-21 21:38:5399 "//sandbox/linux:sandbox",
phosek636bceb32015-10-27 03:36:48100 ]
101 }
[email protected]dab154ee2014-06-13 23:48:50102} else {
103 group("content") {
brettwb7f2c302015-12-08 01:29:21104 public_deps = content_shared_components
[email protected]dab154ee2014-06-13 23:48:50105 }
106}
107
[email protected]189add52014-05-28 16:51:44108grit("resources") {
109 source = "content_resources.grd"
[email protected]ae8d08982014-08-20 19:42:29110 use_qualified_include = true
[email protected]b89c53842014-07-23 16:32:32111 outputs = [
112 "grit/content_resources.h",
113 "content_resources.pak",
[email protected]b89c53842014-07-23 16:32:32114 ]
rockot00668f92016-04-07 18:56:23115 grit_flags = [
116 "-E",
117 "root_out_dir=" + rebase_path(root_out_dir, root_build_dir),
118 ]
119 deps = [
120 "//content/public/app:browser_manifest",
ben20c7ccfc2016-06-28 02:22:58121 "//content/public/app:gpu_manifest",
rockot00668f92016-04-07 18:56:23122 "//content/public/app:renderer_manifest",
ben141b272f2016-06-28 15:47:35123 "//content/public/app:utility_manifest",
ben7095d1a2016-04-13 06:14:58124 "//services/catalog:manifest",
rockot00668f92016-04-07 18:56:23125 ]
[email protected]189add52014-05-28 16:51:44126}
127
[email protected]dab154ee2014-06-13 23:48:50128# This target exists to "hold" the content_export header so we can do proper
129# inclusion testing of it.
130source_set("export") {
brettwb78fc9e2016-03-25 21:02:51131 # Must only be used inside of content.
brettw9af42622014-09-06 21:21:02132 visibility = [ "//content/*" ]
[email protected]dab154ee2014-06-13 23:48:50133 sources = [
tfarina9568fc62015-07-22 23:35:38134 "common/content_export.h",
[email protected]dab154ee2014-06-13 23:48:50135 ]
136}
dprankedb5527d72015-03-08 04:22:47137
brettw4f56c5982015-05-04 22:12:39138# In the GYP build, this file is listed in several targets. In GN just have
139# those targets depend on this one. This can be depended on for any
140# platform for simplicity, and is a no-op on non-Windows.
pmonette18d3ed32015-10-16 21:06:06141source_set("sandbox_helper_win") {
brettw4f56c5982015-05-04 22:12:39142 if (is_win) {
dprankedb5527d72015-03-08 04:22:47143 sources = [
pmonette18d3ed32015-10-16 21:06:06144 "app/sandbox_helper_win.cc",
145 "public/app/sandbox_helper_win.h",
dprankedb5527d72015-03-08 04:22:47146 ]
147
148 deps = [
dprankedb5527d72015-03-08 04:22:47149 "//sandbox",
150 ]
151 }
152}