[M120 Migration][WEBRTC] Fix messenger app preview fail issue
[platform/framework/web/chromium-efl.git] / content / BUILD.gn
1 # Copyright 2014 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/features.gni")
6 import("//build/config/nacl/config.gni")
7 import("//ppapi/buildflags/buildflags.gni")
8 import("//tools/grit/grit_rule.gni")
9
10 # Applied by targets internal to content.
11 config("content_implementation") {
12   defines = [ "CONTENT_IMPLEMENTATION" ]
13   configs = [ "//build/config/compiler:wexit_time_destructors" ]
14 }
15
16 assert(use_blink, "Chromium without blink shouldn't use anything in //content")
17
18 # 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).
45 #
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.
62
63 content_shared_components = [
64   "//content/gpu:gpu_sources",
65   "//content/public/browser:browser_sources",
66   "//content/public/child:child_sources",
67   "//content/public/common:common_sources",
68   "//content/public/gpu:gpu_sources",
69   "//content/public/renderer:renderer_sources",
70   "//content/public/utility:utility_sources",
71 ]
72
73 if (enable_ppapi) {
74   content_shared_components += [ "//content/ppapi_plugin:ppapi_plugin_sources" ]
75 }
76
77 if (is_component_build) {
78   component("content") {
79     public_deps =
80         content_shared_components + [ "//content/public/app:app_sources" ]
81   }
82 } else {
83   group("content") {
84     public_deps = content_shared_components
85   }
86 }
87
88 grit("content_resources") {
89   source = "content_resources.grd"
90
91   outputs = [
92     "grit/content_resources.h",
93     "grit/content_resources_map.cc",
94     "grit/content_resources_map.h",
95     "content_resources.pak",
96   ]
97   deps = [ "//components/ukm/debug:build_ts" ]
98
99   if (is_chromeos_ash) {
100     deps += [
101       "//mojo/public/mojom/base:base_js__generator",
102       "//ui/base/mojom:mojom_js__generator",
103       "//url/mojom:url_mojom_gurl_js__generator",
104       "//url/mojom:url_mojom_origin_js__generator",
105     ]
106   }
107 }
108
109 # This target exists to "hold" the content_export header so we can do proper
110 # inclusion testing of it.
111 source_set("export") {
112   # Must only be used inside of content.
113   visibility = [ "//content/*" ]
114   sources = [ "common/content_export.h" ]
115 }
116
117 # In the GYP build, this file is listed in several targets. In GN just have
118 # those targets depend on this one. This can be depended on for any
119 # platform for simplicity, and is a no-op on non-Windows.
120 source_set("sandbox_helper_win") {
121   if (is_win) {
122     sources = [
123       "app/sandbox_helper_win.cc",
124       "public/app/sandbox_helper_win.h",
125     ]
126
127     deps = [ "//sandbox" ]
128   }
129 }