| # 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/buildflag_header.gni") |
| import("//build/config/ui.gni") |
| import("//content/browser/devtools/features.gni") |
| import("//content/public/common/features.gni") |
| import("//content/public/common/zygote/features.gni") |
| import("//media/media_options.gni") |
| import("//mojo/public/tools/bindings/mojom.gni") |
| import("//third_party/webrtc/webrtc.gni") |
| import("//tools/ipc_fuzzer/ipc_fuzzer.gni") |
| import("//ui/webui/webui_features.gni") |
| |
| if (is_android) { |
| import("//build/config/android/rules.gni") |
| } |
| |
| buildflag_header("buildflags") { |
| header = "buildflags.h" |
| flags = [ |
| "USE_EXTERNAL_POPUP_MENU=$use_external_popup_menu", |
| "ENABLE_DEVTOOLS_FRONTEND=$enable_devtools_frontend", |
| "ENABLE_PLUGINS=$enable_plugins", |
| "ENABLE_SCREEN_CAPTURE=$enable_screen_capture", |
| "LOAD_WEBUI_FROM_DISK=$load_webui_from_disk", |
| ] |
| } |
| |
| # See //content/BUILD.gn for how this works. Note that targets in `//content` |
| # will want to include `:common_sources` directly. |
| group("common") { |
| if (is_component_build) { |
| public_deps = [ "//content" ] |
| } else { |
| public_deps = [ ":common_sources" ] |
| } |
| } |
| |
| component("result_codes") { |
| public = [ "result_codes.h" ] |
| sources = [ |
| "//content/common/content_export.h", |
| "result_codes.cc", |
| ] |
| |
| deps = [ "//base" ] |
| |
| configs += [ "//content:content_implementation" ] |
| } |
| |
| # This target allows other targets to depend on content_descriptors.h which is |
| # a header-only dependency, without bringing in all of content. |
| source_set("content_descriptors") { |
| sources = [ "content_descriptors.h" ] |
| } |
| |
| source_set("content_descriptor_keys") { |
| sources = [ |
| "content_descriptor_keys.cc", |
| "content_descriptor_keys.h", |
| ] |
| } |
| |
| # This target allows other targets to depend on sandbox_support_linux.h which is |
| # a header-only dependency, without bringing in all of content. |
| if (is_linux || is_chromeos) { |
| source_set("sandbox_support_linux") { |
| public = [ |
| "//content/common/content_export.h", |
| "zygote/sandbox_support_linux.h", |
| "zygote/send_zygote_child_ping_linux.h", |
| "zygote/zygote_fork_delegate_linux.h", |
| ] |
| |
| deps = [ |
| "//base", |
| "//content/public/common/zygote:buildflags", |
| ] |
| } |
| } |
| |
| # Forces static linking for targets using the static_switches constants, even |
| # in the component build. This config makes it impossible to use the static |
| # switches target and use the rest of content at the same time, because the |
| # component export flags won't be consistent. |
| config("static_switches_defines") { |
| defines = [ "COMPILE_CONTENT_STATICALLY" ] |
| } |
| |
| # This target allows you to use the content_switches constants and statically |
| # link to it, without depending on the rest of content. This is only for use |
| # without content, or you will get multiply defined symbols. |
| source_set("static_switches") { |
| public = [ "content_switches.h" ] |
| sources = [ |
| "//content/common/content_export.h", |
| "content_switches.cc", |
| ] |
| |
| public_configs = [ ":static_switches_defines" ] |
| public_deps = [ ":buildflags" ] |
| |
| # Deps required by the above headers. |
| deps = [ |
| "//media:media_buildflags", |
| "//tools/v8_context_snapshot:buildflags", |
| ] |
| } |
| |
| # This target allowing depending on content_switches without depending on the |
| # rest of common_sources and its dependencies. Note that unlike the targets |
| # above, this is for use inside of content/ only and does not link statically. |
| source_set("switches") { |
| visibility = [ "//content/*" ] |
| public = [ "content_switches.h" ] |
| sources = [ |
| "//content/common/content_export.h", |
| "content_switches.cc", |
| ] |
| |
| # Deps required by the above header. |
| deps = [ |
| "//media:media_buildflags", |
| "//tools/v8_context_snapshot:buildflags", |
| ] |
| |
| public_deps = [ ":buildflags" ] |
| |
| configs += [ "//content:content_implementation" ] |
| |
| if (enable_ipc_fuzzer) { |
| configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ] |
| } |
| } |
| |
| # This target allows you to use the content MainFunctionParams struct and |
| # statically link to it, without depending on the rest of content. This is only |
| # for use without content, or you will get multiply defined symbols. |
| source_set("static_main_function_params") { |
| public = [ "main_function_params.h" ] |
| sources = [ |
| "//content/common/content_export.h", |
| "main_function_params.cc", |
| "startup_data.h", |
| ] |
| public_deps = [ "//base" ] |
| |
| public_configs = [ ":static_switches_defines" ] |
| } |
| |
| # Target for depending on main_function_params.h. This can be included without |
| # depending on all the rest of content, but unlike static_main_function_params, |
| # this can be combined with the rest of content. |
| component("main_function_params") { |
| public = [ "main_function_params.h" ] |
| sources = [ |
| "//content/common/content_export.h", |
| "main_function_params.cc", |
| "startup_data.h", |
| ] |
| |
| deps = [ "//base" ] |
| |
| configs += [ "//content:content_implementation" ] |
| } |
| |
| source_set("common_sources") { |
| # External code should depend on via ":common" above. |
| visibility = [ "//content/*" ] |
| |
| sources = [ |
| "bindings_policy.h", |
| "btm_utils.h", |
| "cdm_info.cc", |
| "cdm_info.h", |
| "color_parser.h", |
| "common_param_traits.cc", |
| "common_param_traits.h", |
| "common_param_traits_macros.h", |
| "console_message_level.h", |
| "content_client.cc", |
| "content_client.h", |
| "content_constants.cc", |
| "content_constants.h", |
| "content_descriptors.h", |
| "content_features.cc", |
| "content_features.h", |
| "content_paths.h", |
| "content_switch_dependent_feature_overrides.cc", |
| "content_switch_dependent_feature_overrides.h", |
| "drop_data.cc", |
| "drop_data.h", |
| "isolated_world_ids.h", |
| "javascript_dialog_type.h", |
| "mhtml_generation_params.cc", |
| "mhtml_generation_params.h", |
| "origin_util.h", |
| "page_type.h", |
| "page_visibility_state.h", |
| "page_zoom.h", |
| "persistent_notification_status.h", |
| "process_type.h", |
| "profiling.cc", |
| "profiling.h", |
| "pseudonymization_util.cc", |
| "pseudonymization_util.h", |
| "referrer.cc", |
| "referrer.h", |
| "referrer_type_converters.cc", |
| "referrer_type_converters.h", |
| "resource_request_blocked_reason.h", |
| "resource_usage_reporter_type_converters.cc", |
| "resource_usage_reporter_type_converters.h", |
| "sandboxed_process_launcher_delegate.cc", |
| "sandboxed_process_launcher_delegate.h", |
| "socket_permission_request.h", |
| "startup_data.h", |
| "stop_find_action.h", |
| "storage_quota_params.h", |
| "three_d_api_types.h", |
| "url_constants.h", |
| "url_utils.cc", |
| "url_utils.h", |
| "web_identity.h", |
| "webplugininfo.cc", |
| "webplugininfo.h", |
| "webplugininfo_param_traits.h", |
| "widget_type.h", |
| ] |
| |
| if (is_win) { |
| sources += [ |
| "font_cache_dispatcher_win.h", |
| "sandbox_init_win.h", |
| ] |
| } |
| |
| if (is_android) { |
| sources += [ |
| "resource_request_body_android.cc", |
| "resource_request_body_android.h", |
| ] |
| } |
| |
| configs += [ |
| "//build/config:precompiled_headers", |
| "//content:content_implementation", |
| ] |
| |
| public_configs = [ "//v8:external_startup_data" ] |
| |
| public_deps = [ |
| ":interfaces", |
| ":main_function_params", |
| ":renderer_type", |
| ":result_codes", |
| ":switches", |
| "//content/common", |
| "//content/public/common/zygote:buildflags", |
| "//ipc", |
| "//media/capture:capture_base", |
| "//mojo/public/cpp/bindings", |
| "//net", |
| "//services/network:network_service", |
| "//services/network/public/mojom", |
| "//services/service_manager/public/cpp", |
| "//services/service_manager/public/mojom", |
| "//third_party/blink/public:blink_headers", |
| "//third_party/blink/public/mojom:mojom_platform_headers", |
| "//tools/v8_context_snapshot:buildflags", |
| "//ui/accessibility", |
| "//ui/base/cursor/mojom:cursor_type", |
| "//ui/gfx/geometry", |
| "//ui/surface", |
| "//url/ipc:url_ipc", |
| ] |
| deps = [ |
| ":content_descriptor_keys", |
| "//build:android_buildflags", |
| "//build:branding_buildflags", |
| "//build/config/chromebox_for_meetings:buildflags", |
| |
| # This looks needless as we have //content/common in public_deps, but it's |
| # needed because of allow_circular_includes_from. |
| "//content/common:mojo_bindings", |
| "//content/public/common:buildflags", |
| "//device/vr/buildflags", |
| "//media", |
| "//media/mojo/mojom", |
| "//services/network/public/cpp", |
| "//services/service_manager/public/cpp", |
| "//skia", |
| "//storage/common", |
| "//third_party/blink/public/common", |
| "//third_party/icu", |
| "//ui/accessibility", |
| "//ui/base", |
| "//ui/gfx", |
| "//ui/gfx/ipc", |
| "//ui/gfx/ipc/color", |
| "//ui/gfx/ipc/geometry", |
| "//ui/gfx/ipc/skia", |
| ] |
| |
| if (use_aura) { |
| deps += [ "//ui/aura" ] |
| } |
| |
| if (is_android) { |
| deps += [ "//content/public/android:public_common_jni" ] |
| } |
| |
| if (is_win) { |
| deps += [ "//sandbox/win:common" ] |
| } |
| |
| if (is_chromeos) { |
| public_deps += [ "//media/capture/video/chromeos/public" ] |
| } |
| |
| if (is_linux || is_chromeos) { |
| sources += [ |
| "zygote/sandbox_support_linux.h", |
| "zygote/send_zygote_child_ping_linux.h", |
| "zygote/zygote_fork_delegate_linux.h", |
| ] |
| } |
| |
| if (use_zygote) { |
| sources += [ "zygote/zygote_handle.h" ] |
| } |
| |
| if (rtc_use_pipewire) { |
| configs += |
| [ "//third_party/webrtc/modules/desktop_capture:pipewire_config" ] |
| } |
| |
| # //content/common needs to include public headers. |
| allow_circular_includes_from = [ |
| ":interfaces", |
| "//content/common", |
| "//content/common:mojo_bindings", |
| ] |
| |
| if (enable_plugins) { |
| sources += [ |
| "content_plugin_info.cc", |
| "content_plugin_info.h", |
| ] |
| public_deps += [ "//content/public/common:buildflags" ] |
| } |
| |
| if (use_clang_profiling_inside_sandbox) { |
| sources += [ "profiling_utils.h" ] |
| } |
| } |
| |
| mojom("interfaces") { |
| # We don't want Blink variants of these bindings to be generated. |
| disable_variants = true |
| |
| # Must depend on //content/public/common/ instead, for component build. |
| visibility = [ |
| ":common_sources", |
| "//chrome/browser/ash/magic_boost", |
| "//chrome/browser/ash/policy/dlp/dialogs", |
| "//chrome/common:mojo_bindings", |
| "//chrome/common:mojo_bindings_blink", |
| "//content/common/*", |
| "//extensions/common:mojom", |
| "//extensions/common:mojom_blink", |
| ] |
| |
| sources = [ |
| "alternative_error_page_override_info.mojom", |
| "drop_data.mojom", |
| "extra_mojo_js_features.mojom", |
| "resource_usage_reporter.mojom", |
| "webplugininfo.mojom", |
| "window_container_type.mojom", |
| ] |
| |
| if (is_win) { |
| sources += [ "font_cache_win.mojom" ] |
| } |
| |
| deps = [ |
| "//mojo/public/mojom/base", |
| "//services/network/public/mojom", |
| "//skia/public/mojom", |
| "//url/mojom:url_mojom_gurl", |
| |
| # This dependency is really a dependency for the typemaps, but we need |
| # it here so that we can override it correctly for the component build. |
| "//third_party/blink/public/mojom:mojom_platform", |
| ] |
| |
| component_output_prefix = "content_public_common_mojo_bindings" |
| export_class_attribute = "CONTENT_EXPORT" |
| export_define = "CONTENT_IMPLEMENTATION=1" |
| export_header = "content/common/content_export.h" |
| |
| overridden_deps = [ "//third_party/blink/public/mojom:mojom_platform" ] |
| component_deps = [ "//third_party/blink/public/common" ] |
| |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "content.mojom.WebPluginInfo" |
| cpp = "::content::WebPluginInfo" |
| }, |
| ] |
| traits_headers = [ "webplugininfo.h" ] |
| traits_private_headers = [ "webplugininfo_param_traits.h" ] |
| traits_public_deps = [ |
| "//base", |
| "//skia", |
| ] |
| traits_deps = [ "//ipc" ] |
| }, |
| ] |
| |
| if (is_mac) { |
| _common_param_traits_headers = [ "common_param_traits_macros.h" ] |
| _common_param_traits_deps = [ |
| "//ipc", |
| "//services/network/public/cpp:cpp_base", |
| "//services/network/public/mojom", |
| "//third_party/blink/public:blink_headers", |
| "//ui/accessibility:ax_enums_mojo", |
| "//ui/base", |
| "//ui/gfx/ipc", |
| ] |
| |
| cpp_typemaps += [ |
| { |
| types = [ |
| { |
| mojom = "content.mojom.DropData" |
| cpp = "::content::DropData" |
| }, |
| ] |
| traits_headers = [ "drop_data.h" ] |
| traits_private_headers = _common_param_traits_headers |
| traits_deps = _common_param_traits_deps |
| }, |
| ] |
| } |
| } |
| |
| mojom("renderer_type") { |
| sources = [ "media_playback_renderer_type.mojom" ] |
| } |
| |
| if (is_android) { |
| java_cpp_features("java_features_srcjar") { |
| # External code should depend on ":common_java" instead. |
| visibility = [ ":*" ] |
| sources = [ "//content/public/common/content_features.cc" ] |
| class_name = "org.chromium.content_public.common.ContentFeatures" |
| } |
| |
| android_library("common_java") { |
| # Right now, this only includes the Java features. But if we need more Java |
| # files, they should be added here as necessary. |
| srcjar_deps = [ ":java_features_srcjar" ] |
| } |
| } |