[go: nahoru, domu]

blob: 594b6d433bb72662df2fa3025474ab1d33a904b7 [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 =
85 content_shared_components + [ "//content/public/app:both_sources" ]
brettw@chromium.orgdab154ee2014-06-13 23:48:5086 }
phosek636bceb32015-10-27 03:36:4887} else if (is_nacl_nonsfi) {
88 source_set("content") {
89 set_sources_assignment_filter([])
90 sources = [
Tom Sepez903f7f12017-10-26 17:34:0291 "//services/service_manager/sandbox/linux/sandbox_seccomp_bpf_linux.cc",
Tom Sepezc09f5d42017-10-16 19:10:0092 "common/sandbox_init_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 ]
96 set_sources_assignment_filter(sources_assignment_filter)
phosek636bceb32015-10-27 03:36:4897 deps = [
98 "//base",
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",
Tom Sepez15d4e522017-09-27 23:59:05102 "//services/service_manager/sandbox",
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
brettw@chromium.org189add52014-05-28 16:51:44111grit("resources") {
112 source = "content_resources.grd"
Dirk Prankea3727f92017-07-17 17:30:33113
114 # The .grd contains references to generated files.
115 source_is_generated = true
116
brettw@chromium.orgb89c53842014-07-23 16:32:32117 outputs = [
118 "grit/content_resources.h",
119 "content_resources.pak",
brettw@chromium.orgb89c53842014-07-23 16:32:32120 ]
rockot00668f92016-04-07 18:56:23121 grit_flags = [
122 "-E",
rockot0a386b5d92017-01-25 00:14:34123 "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
rockot00668f92016-04-07 18:56:23124 ]
125 deps = [
Nasko Oskov3e19fbd2018-06-13 00:13:29126 "//content/browser/process_internals:mojo_bindings_js",
rockot00668f92016-04-07 18:56:23127 ]
brettw@chromium.org189add52014-05-28 16:51:44128}
129
brettw@chromium.orgdab154ee2014-06-13 23:48:50130# This target exists to "hold" the content_export header so we can do proper
131# inclusion testing of it.
132source_set("export") {
brettwb78fc9e2016-03-25 21:02:51133 # Must only be used inside of content.
brettw9af42622014-09-06 21:21:02134 visibility = [ "//content/*" ]
brettw@chromium.orgdab154ee2014-06-13 23:48:50135 sources = [
tfarina9568fc62015-07-22 23:35:38136 "common/content_export.h",
brettw@chromium.orgdab154ee2014-06-13 23:48:50137 ]
138}
dprankedb5527d72015-03-08 04:22:47139
brettw4f56c5982015-05-04 22:12:39140# In the GYP build, this file is listed in several targets. In GN just have
141# those targets depend on this one. This can be depended on for any
142# platform for simplicity, and is a no-op on non-Windows.
pmonette18d3ed32015-10-16 21:06:06143source_set("sandbox_helper_win") {
brettw4f56c5982015-05-04 22:12:39144 if (is_win) {
dprankedb5527d72015-03-08 04:22:47145 sources = [
pmonette18d3ed32015-10-16 21:06:06146 "app/sandbox_helper_win.cc",
147 "public/app/sandbox_helper_win.h",
dprankedb5527d72015-03-08 04:22:47148 ]
Tom Sepez9b460f42017-08-10 19:58:10149
dprankedb5527d72015-03-08 04:22:47150 deps = [
dprankedb5527d72015-03-08 04:22:47151 "//sandbox",
152 ]
153 }
154}