Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / BUILD.gn
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
5 import("//tools/grit/grit_rule.gni")
6
7 # Applied by targets internal to content.
8 config("content_implementation") {
9   defines = [ "CONTENT_IMPLEMENTATION" ]
10 }
11
12 # When targets depend on, e.g. //content/public/browser, what happens? To
13 # facilitate the complexity here, the "public" targets are groups that forward
14 # to the right thing depending on the build mode. Say for additional
15 # illustration, the public browser sources also depend on the public common
16 # ones.
17 #
18 # The non-component build is easy:
19 # foo ->
20 #   //content/public/browser (group) ->
21 #     //content/public/browser:browser_sources (source set) ->
22 #       //content/browser (source set, this is the non-public browser target)
23 #       //content/public/common:common_sources (source set)
24 #
25 # The component build is more complicated because we want everybody to depend on
26 # one content shared library regardless of which public target they depend on:
27 # foo ->
28 #   //content/public/browser (group) ->
29 #     //content (shared library) ->
30 #       //content/public/browser:browser_sources (source set) ->
31 #         //content/browser (source set; this is the non-public browser target)
32 #         //content/public/common:common_sources (source set)
33 #
34 # That the internal content dependencies must depend on the *_sources targets
35 # to avoid dependency cycles, and external dependencies must depend on the
36 # //content/public/browser and similar targets to avoid double-linking (these
37 # targets make sure the dependency goes through the content shared library
38 # when doing a component build).
39
40 content_shared_components = [
41   "//content/gpu",
42   "//content/public/browser:browser_sources",
43   "//content/public/child:child_sources",
44   "//content/public/common:common_sources",
45   "//content/public/plugin:plugin_sources",
46   "//content/public/renderer:renderer_sources",
47   "//content/public/utility:utility_sources",
48 ]
49
50 if (enable_plugins) {
51   content_shared_components += [ "//content/ppapi_plugin" ]
52 }
53
54 if (is_component_build) {
55   shared_library("content") {
56     public_deps = content_shared_components + [
57       "//content/public/app:both_sources",
58     ]
59   }
60 } else {
61   group("content") {
62     deps = content_shared_components
63   }
64 }
65
66 grit("resources") {
67   source = "content_resources.grd"
68   use_qualified_include = true
69   outputs = [
70     "grit/content_resources.h",
71     "content_resources.pak",
72     "content_resources.rc",
73   ]
74 }
75
76 # This target exists to "hold" the content_export header so we can do proper
77 # inclusion testing of it.
78 source_set("export") {
79   visibility = [ "//content/*" ]
80   sources = [
81     "content/common/content_export.h"
82   ]
83 }