[email protected] | 7e4c3314 | 2014-05-21 22:01:32 | [diff] [blame] | 1 | # 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] | 189add5 | 2014-05-28 16:51:44 | [diff] [blame] | 5 | import("//tools/grit/grit_rule.gni") |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 6 | import("//build/config/nacl/config.gni") |
brettw | 4b46108 | 2016-11-19 18:55:16 | [diff] [blame] | 7 | import("//ppapi/features/features.gni") |
[email protected] | 189add5 | 2014-05-28 16:51:44 | [diff] [blame] | 8 | |
| 9 | # Applied by targets internal to content. |
| 10 | config("content_implementation") { |
| 11 | defines = [ "CONTENT_IMPLEMENTATION" ] |
rsesek | 99679aa | 2016-06-28 21:24:17 | [diff] [blame] | 12 | configs = [ "//build/config/compiler:wexit_time_destructors" ] |
[email protected] | 189add5 | 2014-05-28 16:51:44 | [diff] [blame] | 13 | } |
| 14 | |
Brett Wilson | 8f132304 | 2014-09-11 16:58:56 | [diff] [blame] | 15 | # 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). |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 42 | # |
| 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 Wilson | 8f132304 | 2014-09-11 16:58:56 | [diff] [blame] | 59 | |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 60 | if (!is_nacl_nonsfi) { |
| 61 | content_shared_components = [ |
| 62 | "//content/gpu:gpu_sources", |
| 63 | "//content/public/browser:browser_sources", |
| 64 | "//content/public/child:child_sources", |
kcwu | 08377ad | 2016-02-18 19:12:42 | [diff] [blame] | 65 | "//content/public/gpu:gpu_sources", |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 66 | "//content/public/common:common_sources", |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 67 | "//content/public/renderer:renderer_sources", |
| 68 | "//content/public/utility:utility_sources", |
| 69 | ] |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 70 | |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 71 | if (enable_plugins) { |
| 72 | content_shared_components += |
| 73 | [ "//content/ppapi_plugin:ppapi_plugin_sources" ] |
| 74 | } |
jamesr | 5008174 | 2014-09-09 07:52:22 | [diff] [blame] | 75 | } |
| 76 | |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 77 | if (is_component_build) { |
agrieve | 3f53232 | 2016-01-05 03:23:15 | [diff] [blame] | 78 | component("content") { |
scottmg | 7afc409 | 2014-12-03 19:22:42 | [diff] [blame] | 79 | public_deps = |
| 80 | content_shared_components + [ "//content/public/app:both_sources" ] |
brettw | ba7a73d | 2015-08-31 22:17:39 | [diff] [blame] | 81 | deps = [ |
| 82 | "//build/config/sanitizers:deps", |
| 83 | ] |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 84 | } |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 85 | } 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", |
sammc | 9e87807 | 2016-09-22 02:56:21 | [diff] [blame] | 93 | "public/common/mojo_channel_switches.cc", |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 94 | ] |
| 95 | set_sources_assignment_filter(sources_assignment_filter) |
| 96 | |
| 97 | defines = [ "USE_SECCOMP_BPF=1" ] |
| 98 | |
| 99 | deps = [ |
| 100 | "//base", |
Brett Wilson | 0748bf41 | 2016-11-22 17:55:46 | [diff] [blame] | 101 | "//media:media_features", |
brettw | d064ace4e | 2016-07-21 21:38:53 | [diff] [blame] | 102 | "//sandbox/linux:sandbox", |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 103 | ] |
| 104 | } |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 105 | } else { |
| 106 | group("content") { |
brettw | b7f2c30 | 2015-12-08 01:29:21 | [diff] [blame] | 107 | public_deps = content_shared_components |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 108 | } |
| 109 | } |
| 110 | |
[email protected] | 189add5 | 2014-05-28 16:51:44 | [diff] [blame] | 111 | grit("resources") { |
| 112 | source = "content_resources.grd" |
[email protected] | ae8d0898 | 2014-08-20 19:42:29 | [diff] [blame] | 113 | use_qualified_include = true |
[email protected] | b89c5384 | 2014-07-23 16:32:32 | [diff] [blame] | 114 | outputs = [ |
| 115 | "grit/content_resources.h", |
| 116 | "content_resources.pak", |
[email protected] | b89c5384 | 2014-07-23 16:32:32 | [diff] [blame] | 117 | ] |
rockot | 00668f9 | 2016-04-07 18:56:23 | [diff] [blame] | 118 | 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", |
ben | 20c7ccfc | 2016-06-28 02:22:58 | [diff] [blame] | 124 | "//content/public/app:gpu_manifest", |
rockot | da988790 | 2016-08-19 20:46:42 | [diff] [blame] | 125 | "//content/public/app:plugin_manifest", |
rockot | 00668f9 | 2016-04-07 18:56:23 | [diff] [blame] | 126 | "//content/public/app:renderer_manifest", |
ben | 141b272f | 2016-06-28 15:47:35 | [diff] [blame] | 127 | "//content/public/app:utility_manifest", |
ben | 7095d1a | 2016-04-13 06:14:58 | [diff] [blame] | 128 | "//services/catalog:manifest", |
rockot | 00668f9 | 2016-04-07 18:56:23 | [diff] [blame] | 129 | ] |
[email protected] | 189add5 | 2014-05-28 16:51:44 | [diff] [blame] | 130 | } |
| 131 | |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 132 | # This target exists to "hold" the content_export header so we can do proper |
| 133 | # inclusion testing of it. |
| 134 | source_set("export") { |
brettw | b78fc9e | 2016-03-25 21:02:51 | [diff] [blame] | 135 | # Must only be used inside of content. |
brettw | 9af4262 | 2014-09-06 21:21:02 | [diff] [blame] | 136 | visibility = [ "//content/*" ] |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 137 | sources = [ |
tfarina | 9568fc6 | 2015-07-22 23:35:38 | [diff] [blame] | 138 | "common/content_export.h", |
[email protected] | dab154ee | 2014-06-13 23:48:50 | [diff] [blame] | 139 | ] |
| 140 | } |
dpranke | db5527d7 | 2015-03-08 04:22:47 | [diff] [blame] | 141 | |
brettw | 4f56c598 | 2015-05-04 22:12:39 | [diff] [blame] | 142 | # 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. |
pmonette | 18d3ed3 | 2015-10-16 21:06:06 | [diff] [blame] | 145 | source_set("sandbox_helper_win") { |
brettw | 4f56c598 | 2015-05-04 22:12:39 | [diff] [blame] | 146 | if (is_win) { |
dpranke | db5527d7 | 2015-03-08 04:22:47 | [diff] [blame] | 147 | sources = [ |
pmonette | 18d3ed3 | 2015-10-16 21:06:06 | [diff] [blame] | 148 | "app/sandbox_helper_win.cc", |
| 149 | "public/app/sandbox_helper_win.h", |
dpranke | db5527d7 | 2015-03-08 04:22:47 | [diff] [blame] | 150 | ] |
| 151 | |
| 152 | deps = [ |
dpranke | db5527d7 | 2015-03-08 04:22:47 | [diff] [blame] | 153 | "//sandbox", |
| 154 | ] |
| 155 | } |
| 156 | } |