blob: 6be5a789274a0cd480b85a4d7948fb7c6d045e7b [file] [log] [blame]
# 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("//build/config/ui.gni")
import("//chromeos/assistant/assistant.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//ui/base/ui_features.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",
"//services/service_manager",
"//services/service_manager/embedder",
"//services/service_manager/public/cpp",
]
if (enable_mus) {
public_app_shared_deps += [ "//ui/aura" ]
}
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",
"//content/public/gpu:gpu_sources",
"//content/public/renderer:renderer_sources",
"//content/public/utility:utility_sources",
]
allow_circular_includes_from = [
# This target is a pair with the non-public version. They always go
# together and include headers from each other.
"//content/app:both",
]
}
# 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",
"//content/public/gpu:gpu_sources",
"//content/public/renderer:renderer_sources",
"//content/public/utility:utility_sources",
]
allow_circular_includes_from = [
# This target is a pair with the non-public version. They always go
# together and include headers from each other.
"//content/app:both",
]
}
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",
]
allow_circular_includes_from = [
# This target is a pair with the non-public version. They always go
# together and include headers from each other.
"//content/app:browser",
]
}
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",
]
allow_circular_includes_from = [
# This target is a pair with the non-public version. They always go
# together and include headers from each other.
"//content/app:child",
]
}
} 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",
]
}
}
}
source_set("content_browser_manifest") {
sources = [
"content_browser_manifest.cc",
"content_browser_manifest.h",
]
deps = [
":v8_snapshot_overlay_manifest",
"//base",
"//content/public/common:service_names",
"//services/content/public/cpp:manifest",
"//services/file/public/cpp:manifest",
]
public_deps = [
"//services/service_manager/public/cpp",
]
}
source_set("content_gpu_manifest") {
sources = [
"content_gpu_manifest.cc",
"content_gpu_manifest.h",
]
deps = [
"//base",
"//content/public/common:service_names",
]
public_deps = [
"//services/service_manager/public/cpp",
]
}
source_set("content_packaged_services_manifest") {
sources = [
"content_packaged_services_manifest.cc",
"content_packaged_services_manifest.h",
]
deps = [
"//base",
"//components/services/heap_profiling/public/cpp:manifest",
"//content/public/common:service_names",
"//media/mojo/services:cdm_manifest",
"//media/mojo/services:media_manifest",
"//services/audio/public/cpp:manifest",
"//services/data_decoder/public/cpp:manifest",
"//services/device/public/cpp:manifest",
"//services/media_session/public/cpp:manifest",
"//services/metrics/public/cpp:manifest",
"//services/network/public/cpp:manifest",
"//services/resource_coordinator/public/cpp:manifest",
"//services/shape_detection/public/cpp:manifest",
"//services/tracing:manifest",
"//services/video_capture/public/cpp:manifest",
"//services/viz/public/cpp:manifest",
]
public_deps = [
"//services/service_manager/public/cpp",
]
if (is_linux) {
deps += [ "//components/services/font/public/cpp:manifest" ]
}
if (is_chromeos) {
deps += [ "//chromeos/assistant:buildflags" ]
if (enable_cros_libassistant) {
deps +=
[ "//chromeos/services/assistant/public/cpp:audio_decoder_manifest" ]
}
}
}
source_set("content_plugin_manifest") {
sources = [
"content_plugin_manifest.cc",
"content_plugin_manifest.h",
]
deps = [
"//base",
"//content/public/common:service_names",
]
public_deps = [
"//services/service_manager/public/cpp",
]
}
source_set("content_renderer_manifest") {
sources = [
"content_renderer_manifest.cc",
"content_renderer_manifest.h",
]
deps = [
":v8_snapshot_overlay_manifest",
"//base",
"//content/public/common:service_names",
]
public_deps = [
"//services/service_manager/public/cpp",
]
}
source_set("content_utility_manifest") {
sources = [
"content_utility_manifest.cc",
"content_utility_manifest.h",
]
deps = [
":v8_snapshot_overlay_manifest",
"//base",
"//content/public/common:service_names",
]
public_deps = [
"//services/service_manager/public/cpp",
]
}
source_set("v8_snapshot_overlay_manifest") {
sources = [
"v8_snapshot_overlay_manifest.cc",
"v8_snapshot_overlay_manifest.h",
]
deps = [
"//base",
"//content/public/common:content_descriptor_keys",
]
public_deps = [
"//services/service_manager/public/cpp",
]
configs += [ "//tools/v8_context_snapshot:use_v8_context_snapshot" ]
}
group("service_manifests") {
public_deps = [
":content_browser_manifest",
":content_gpu_manifest",
":content_packaged_services_manifest",
":content_plugin_manifest",
":content_renderer_manifest",
":content_utility_manifest",
]
}