summaryrefslogtreecommitdiff
path: root/chromium/content/public/app/BUILD.gn
blob: 73e5d1e901c0a75a42b986283a77de6dd9e9acdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# App different than the regular content subcomponents (see comments in
# //content/BUILD.gn) because it has to support the browser/child process split
# (the "both" target include both browser and child process files and is used
# for testing).
#
# In non-component mode, browser, child, and both all follow the same structure:
# foo ->
#   //content/public/app:child (group) ->
#     //content/public/app:child_sources (source set) ->
#       //content/app:child (source set)

# In component mode, content is linked as one big turd so there is only one
# app target containing sources ("both") and the other ones forward to it:
# foo ->
#   //content/public/app:child (group; "browser" and "both" ones look the same)
#     //content (shared library) ->
#       //content/public/app:both_sources (source set)

import("//build/config/chrome_build.gni")
import("//mojo/public/mojo_application_manifest.gni")

public_app_shared_sources = [
  "content_jni_onload.h",
  "content_main.h",
  "content_main_delegate.cc",
  "content_main_delegate.h",
  "content_main_runner.h",
  "sandbox_helper_win.h",
]

public_app_shared_deps = [
  "//base",
  "//base:i18n",
  "//content:export",
  "//content/public/common:common_sources",
  "//content/public/gpu:gpu_sources",
  "//content/public/renderer:renderer_sources",
  "//content/public/utility:utility_sources",
]

if (is_component_build) {
  source_set("both_sources") {
    # Only the main content shared library can pull this in.
    visibility = [ "//content:content" ]

    sources = public_app_shared_sources

    configs += [ "//content:content_implementation" ]

    deps = public_app_shared_deps + [
             "//content/app:both",
             "//content/public/browser:browser_sources",
           ]
  }

  # These all just forward to content, which in turn depends on "both_sources".
  group("browser") {
    public_deps = [
      "//content",
    ]
  }
  group("child") {
    public_deps = [
      "//content",
    ]
  }
  group("both") {
    public_deps = [
      "//content",
    ]
  }
} else {
  # content_main_delegate.cc conditionally includes content_browser_client.h
  # from //content/public/browser when it's not the child build. However,
  # the header checker doesn't know this doesn't apply and throws an error.
  # So all of these targets set check_includes = false.
  #
  # TODO(brettw) either teach the header checker to understand simple
  # ifdefs or split the file apart so we can enable header checking here.
  # Furthermore, since this file exists in more than one target, they all
  # have to opt-out of header checking (a file is checked once for all
  # targets using a source file).

  source_set("both") {
    check_includes = false  # See comment above.

    sources = public_app_shared_sources
    configs += [ "//content:content_implementation" ]
    deps = public_app_shared_deps + [
             "//content/app:both",
             "//content/public/browser",
             "//content/public/common",
           ]
  }

  if (is_multi_dll_chrome) {
    source_set("browser") {
      check_includes = false  # See comment above.

      sources = public_app_shared_sources

      defines = [ "CHROME_MULTIPLE_DLL_BROWSER" ]
      configs += [ "//content:content_implementation" ]

      deps = public_app_shared_deps + [
               "//content/app:browser",
               "//content/public/browser",
               "//content/public/common",
             ]
    }

    source_set("child") {
      check_includes = false  # See comment above.

      sources = public_app_shared_sources

      defines = [ "CHROME_MULTIPLE_DLL_CHILD" ]
      configs += [ "//content:content_implementation" ]

      deps = public_app_shared_deps + [
               "//content/app:child",
               "//content/public/common",
             ]
    }
  } else {
    # When the multi-DLL build is disabled, there is only one type of the
    # "app" target, and "browser" and "child" are the same as "both".
    group("browser") {
      deps = [
        ":both",
      ]
    }
    group("child") {
      deps = [
        ":both",
      ]
    }
  }
}

mojo_application_manifest("browser_manifest") {
  type = "exe"
  application_name = "content_browser"
  source = "mojo/content_browser_manifest.json"
  packaged_applications = [
    "media",
    "user",
  ]
  deps = [
    "//media/mojo/services:media_manifest",
    "//services/user:manifest",
  ]
}

mojo_application_manifest("gpu_manifest") {
  type = "exe"
  application_name = "content_gpu"
  source = "mojo/content_gpu_manifest.json"
}

mojo_application_manifest("renderer_manifest") {
  type = "exe"
  application_name = "content_renderer"
  source = "mojo/content_renderer_manifest.json"
}

mojo_application_manifest("utility_manifest") {
  type = "exe"
  application_name = "content_utility"
  source = "mojo/content_utility_manifest.json"
}