blob: e0124daba07affa423505745a8b1faa4c0e34082 [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")
brettw4b461082016-11-19 18:55:167import("//ppapi/features/features.gni")
[email protected]189add52014-05-28 16:51:448
9# Applied by targets internal to content.
10config("content_implementation") {
11 defines = [ "CONTENT_IMPLEMENTATION" ]
rsesek99679aa2016-06-28 21:24:1712 configs = [ "//build/config/compiler:wexit_time_destructors" ]
[email protected]189add52014-05-28 16:51:4413}
14
Brett Wilson8f1323042014-09-11 16:58:5615# When targets depend on, e.g. //content/public/browser, what happens? To
16# facilitate the complexity here, the "public" targets are groups that forward
17# to the right thing depending on the build mode. Say for additional
18# illustration, the public browser sources also depend on the public common
19# ones.
20#
21# The non-component build is easy:
22# foo ->
23# //content/public/browser (group) ->
24# //content/public/browser:browser_sources (source set) ->
25# //content/browser (source set, this is the non-public browser target)
26# //content/public/common:common_sources (source set)
27#
28# The component build is more complicated because we want everybody to depend on
29# one content shared library regardless of which public target they depend on:
30# foo ->
31# //content/public/browser (group) ->
32# //content (shared library) ->
33# //content/public/browser:browser_sources (source set) ->
34# //content/browser (source set; this is the non-public browser target)
35# //content/public/common:common_sources (source set)
36#
37# That the internal content dependencies must depend on the *_sources targets
38# to avoid dependency cycles, and external dependencies must depend on the
39# //content/public/browser and similar targets to avoid double-linking (these
40# targets make sure the dependency goes through the content shared library
41# when doing a component build).
brettwb78fc9e2016-03-25 21:02:5142#
43# TESTS
44# -----
45# Tests are a challenge. The content tests need to access internals of
46# content/browser, for example, but the tests themselves are outside of the
47# content component (which is a shared library in the component build). To
48# prevent external-to-content targets from depending on private headers,
49# the non-public content/browser target is not a public dep of the content
50# component. But this means there is also no public path for the content
51# tests and no way to restrict that just to //content/test/* if we added one.
52#
53# As a result, we check deps for //content/test/* only in non-component builds
54# (which should verify the dependencies are correct for both component and
55# non-component cases equally). There are targets like
56# //content/browser:for_content_tests that allow content/test to depend on the
57# //content/browser target only in non-component builds (when there are no
58# linking problems) for when check is enabled.
Brett Wilson8f1323042014-09-11 16:58:5659
phosek636bceb32015-10-27 03:36:4860if (!is_nacl_nonsfi) {
61 content_shared_components = [
62 "//content/gpu:gpu_sources",
63 "//content/public/browser:browser_sources",
64 "//content/public/child:child_sources",
kcwu08377ad2016-02-18 19:12:4265 "//content/public/gpu:gpu_sources",
phosek636bceb32015-10-27 03:36:4866 "//content/public/common:common_sources",
phosek636bceb32015-10-27 03:36:4867 "//content/public/renderer:renderer_sources",
68 "//content/public/utility:utility_sources",
69 ]
[email protected]dab154ee2014-06-13 23:48:5070
phosek636bceb32015-10-27 03:36:4871 if (enable_plugins) {
72 content_shared_components +=
73 [ "//content/ppapi_plugin:ppapi_plugin_sources" ]
74 }
jamesr50081742014-09-09 07:52:2275}
76
[email protected]dab154ee2014-06-13 23:48:5077if (is_component_build) {
agrieve3f532322016-01-05 03:23:1578 component("content") {
scottmg7afc4092014-12-03 19:22:4279 public_deps =
80 content_shared_components + [ "//content/public/app:both_sources" ]
brettwba7a73d2015-08-31 22:17:3981 deps = [
82 "//build/config/sanitizers:deps",
83 ]
[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 = [
89 "common/sandbox_linux/sandbox_init_linux.cc",
90 "common/sandbox_linux/sandbox_seccomp_bpf_linux.cc",
91 "common/send_zygote_child_ping_linux.cc",
92 "public/common/content_switches.cc",
sammc9e878072016-09-22 02:56:2193 "public/common/mojo_channel_switches.cc",
phosek636bceb32015-10-27 03:36:4894 ]
95 set_sources_assignment_filter(sources_assignment_filter)
96
97 defines = [ "USE_SECCOMP_BPF=1" ]
98
99 deps = [
100 "//base",
Brett Wilson0748bf412016-11-22 17:55:46101 "//media:media_features",
brettwd064ace4e2016-07-21 21:38:53102 "//sandbox/linux:sandbox",
phosek636bceb32015-10-27 03:36:48103 ]
104 }
[email protected]dab154ee2014-06-13 23:48:50105} else {
106 group("content") {
brettwb7f2c302015-12-08 01:29:21107 public_deps = content_shared_components
[email protected]dab154ee2014-06-13 23:48:50108 }
109}
110
[email protected]189add52014-05-28 16:51:44111grit("resources") {
112 source = "content_resources.grd"
[email protected]ae8d08982014-08-20 19:42:29113 use_qualified_include = true
[email protected]b89c53842014-07-23 16:32:32114 outputs = [
115 "grit/content_resources.h",
116 "content_resources.pak",
[email protected]b89c53842014-07-23 16:32:32117 ]
rockot00668f92016-04-07 18:56:23118 grit_flags = [
119 "-E",
120 "root_out_dir=" + rebase_path(root_out_dir, root_build_dir),
121 ]
122 deps = [
123 "//content/public/app:browser_manifest",
ben20c7ccfc2016-06-28 02:22:58124 "//content/public/app:gpu_manifest",
rockotda9887902016-08-19 20:46:42125 "//content/public/app:plugin_manifest",
rockot00668f92016-04-07 18:56:23126 "//content/public/app:renderer_manifest",
ben141b272f2016-06-28 15:47:35127 "//content/public/app:utility_manifest",
ben7095d1a2016-04-13 06:14:58128 "//services/catalog:manifest",
rockot00668f92016-04-07 18:56:23129 ]
[email protected]189add52014-05-28 16:51:44130}
131
[email protected]dab154ee2014-06-13 23:48:50132# This target exists to "hold" the content_export header so we can do proper
133# inclusion testing of it.
134source_set("export") {
brettwb78fc9e2016-03-25 21:02:51135 # Must only be used inside of content.
brettw9af42622014-09-06 21:21:02136 visibility = [ "//content/*" ]
[email protected]dab154ee2014-06-13 23:48:50137 sources = [
tfarina9568fc62015-07-22 23:35:38138 "common/content_export.h",
[email protected]dab154ee2014-06-13 23:48:50139 ]
140}
dprankedb5527d72015-03-08 04:22:47141
brettw4f56c5982015-05-04 22:12:39142# In the GYP build, this file is listed in several targets. In GN just have
143# those targets depend on this one. This can be depended on for any
144# platform for simplicity, and is a no-op on non-Windows.
pmonette18d3ed32015-10-16 21:06:06145source_set("sandbox_helper_win") {
brettw4f56c5982015-05-04 22:12:39146 if (is_win) {
dprankedb5527d72015-03-08 04:22:47147 sources = [
pmonette18d3ed32015-10-16 21:06:06148 "app/sandbox_helper_win.cc",
149 "public/app/sandbox_helper_win.h",
dprankedb5527d72015-03-08 04:22:47150 ]
151
152 deps = [
dprankedb5527d72015-03-08 04:22:47153 "//sandbox",
154 ]
155 }
156}