blob: e3c038ff40c5f6cc8e3aa6ddad3dee3889a0eae5 [file] [log] [blame] [edit]
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/apple/mobile_config.gni")
import("//build/config/chrome_build.gni")
import("//third_party/tflite/features.gni")
extra_configs = [
"//build/config/compiler:wexit_time_destructors",
"//content:content_implementation",
"//v8:external_startup_data",
]
content_app_deps = [
"//base",
"//base:i18n",
"//content:export",
"//content:sandbox_helper_win",
"//content/public/common:common_sources",
"//crypto",
"//mojo/core/embedder",
"//mojo/public/cpp/platform",
"//services/tracing/public/cpp",
"//ui/base",
"//ui/gfx",
"//ui/gfx/geometry",
]
if (is_win) {
content_app_deps += [ "//sandbox" ]
} else if (is_android) {
# Many of these are required for JNI registration.
content_app_deps += [
"//content/browser",
"//content/child",
"//content/public/android:content_app_jni",
"//device/bluetooth",
"//device/gamepad",
"//media",
"//media/capture",
"//media/midi",
"//net",
"//skia",
"//third_party/cpu_features:ndk_compat",
"//ui/android",
"//ui/events",
"//ui/shell_dialogs",
]
}
if (is_ios && target_platform == "iphoneos") {
content_app_deps += [ "//content/app/ios/appex:child_process_bridge" ]
}
if (is_android) {
config("javaless_renderers_define") {
if (enable_javaless_renderers) {
defines = [ "JAVALESS_RENDERERS" ]
}
}
}
# Compile content_main_runner_impl.[h, cc] in a separate target to exempt from
# GN header checking without exempting any other source file. These files
# includes headers of all process types and varies significantly per platform
# in between browser and child. Otherwise it would require many "nogncheck"
# annotations that would both be useless and add noise.
source_set("content_main_runner_app") {
visibility = [ ":app" ]
check_includes = false
sources = [
"content_main_runner_impl.cc",
"content_main_runner_impl.h",
]
configs += extra_configs
deps = content_app_deps + [
"//components/power_monitor",
"//content/browser",
"//content/gpu:gpu_sources",
"//content/public/browser:browser_sources",
"//content/public/gpu:gpu_sources",
"//content/public/renderer:renderer_sources",
"//content/public/utility:utility_sources",
"//content/renderer",
"//content/utility",
"//content/zygote",
"//third_party/tflite:buildflags",
"//tools/v8_context_snapshot:buildflags",
]
if (build_tflite_with_xnnpack) {
deps += [ "//third_party/cpuinfo" ]
}
}
if (is_android && enable_javaless_renderers) {
# Since javaless renderers provide their own entry point into the shared
# library, for component builds to work, we require this to fall into the root
# component. Thus, you must add this directly to the shared_library target
# this should end up in.
source_set("javaless_renderer") {
configs += [ ":javaless_renderers_define" ]
sources = [ "android/javaless_child_process_service.cc" ]
deps = [
":app",
"//base",
"//base:build_info_aidl_native",
"//base:process_launcher_aidl_native",
"//content/common",
"//content/public/app",
]
}
}
source_set("app") {
# TODO(thakis): The comment above content_main_runner_app suggests this
# line shouldn't be here; try removing it.
check_includes = false
sources = [
"content_main.cc",
"initialize_mojo_core.cc",
"mojo/mojo_init.cc",
"mojo/mojo_init.h",
"mojo_ipc_support.cc",
"mojo_ipc_support.h",
]
configs += extra_configs
deps = content_app_deps + [ "//ipc" ]
public_deps = [ ":content_main_runner_app" ]
# Only the public target should depend on this. All other targets (even
# internal content ones) should depend on the public one.
visibility = [
":for_content_tests", # See top of //content/BUILD.gn for why.
":javaless_renderer",
"//content/public/app:*",
]
if (is_android) {
sources += [
"android/content_child_process_service_delegate.cc",
"android/content_jni_onload.cc",
"android/content_main_android.cc",
"android/content_main_android.h",
"android/library_loader_hooks.cc",
"android/library_loader_hooks.h",
]
deps += [
"//mojo/public/java/system:native_support",
"//ui/gl",
]
}
if (is_mac) {
sources += [
"mac_init.h",
"mac_init.mm",
]
frameworks = [ "Foundation.framework" ]
}
}
# See comment at the top of //content/BUILD.gn for how this works.
group("for_content_tests") {
visibility = [ "//content/test/*" ]
if (!is_component_build) {
public_deps = [ ":app" ]
}
}