| # 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. |
| |
| import("//tools/grit/grit_rule.gni") |
| |
| gypi_values = exec_script( |
| "//build/gypi_to_gn.py", |
| [ rebase_path("../chrome_common.gypi") ], |
| "scope", |
| [ "../chrome_common.gypi" ]) |
| |
| # GYP version: chrome/chrome_resources.gyp:chrome_resources |
| # (generate_common_resources action) |
| grit("resources") { |
| source = "common_resources.grd" |
| output_dir = "$root_gen_dir/chrome" |
| output_name = "common_resources" |
| outputs = [ |
| "grit/common_resources.h", |
| "common_resources.pak", |
| ] |
| } |
| |
| # GYP version: chrome/chrome_resources.gyp:chrome_resources |
| # (generate_extensions_api_resources action) |
| if (enable_extensions) { |
| |
| grit("extensions_api_resources") { |
| source = "extensions_api_resources.grd" |
| output_dir = "$root_gen_dir/chrome" |
| outputs = [ |
| "grit/extensions_api_resources.h", |
| "extensions_api_resources.pak", |
| ] |
| } |
| |
| } |
| |
| # GYP version: chrome/chrome_common.gyp:common |
| static_library("common") { |
| sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome") |
| defines = [] |
| |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| |
| deps = [ |
| ":version", |
| "//base:base", |
| "//base:i18n", |
| "//base:prefs", |
| "//base:base_static", |
| "//chrome:resources", |
| "//chrome:strings", |
| "//chrome/app/theme:theme_resources", |
| "//chrome/common:constants", |
| "//chrome/common/net", |
| "//chrome/common/safe_browsing:proto", |
| "//chrome/installer/util", |
| "//components/cloud_devices/common", |
| "//components/content_settings/core/common", |
| "//components/json_schema", |
| "//components/metrics", |
| "//components/policy:policy_component_common", |
| "//components/translate/core/common", |
| "//components/variations", |
| "//content/public/common", |
| "//crypto", |
| "//extensions/common:common_constants", |
| "//media/cast:net", |
| "//net", |
| "//skia", |
| "//third_party/icu", |
| "//third_party/libxml", |
| "//third_party/sqlite", |
| "//third_party/zlib:zip", |
| "//ui/resources:resources", |
| "//url", |
| ] |
| |
| if (is_ios) { |
| sources += [ |
| # Use this Mac file that was filtered out. |
| "chrome_version_info_mac.mm", |
| ] |
| } else { |
| # Non-iOS. |
| deps += [ |
| "//components/visitedlink/common", |
| "//components/autofill/content/common", |
| "//components/autofill/core/common", |
| "//components/password_manager/content/common", |
| "//components/password_manager/core/common", |
| "//components/signin/core/common", |
| "//components/translate/content/common", |
| "//ipc", |
| "//third_party/re2", |
| "//third_party/widevine/cdm:version_h", |
| ] |
| } |
| |
| if (enable_extensions) { |
| sources += rebase_path( |
| gypi_values.chrome_common_extensions_sources, |
| ".", "//chrome") |
| deps += [ |
| "//device/usb", |
| "//chrome/common/extensions/api", |
| "//extensions/common", |
| "//extensions/common/api", |
| "//extensions:extensions_resources", |
| "//extensions/strings", |
| ] |
| } |
| |
| if (is_win || is_mac) { |
| sources += rebase_path( |
| gypi_values.chrome_common_win_mac_sources, |
| ".", "//chrome") |
| if (use_openssl) { |
| sources -= [ |
| "extensions/api/networking_private/networking_private_crypto_nss.cc", |
| ] |
| # networking_private_crypto_openssl.cc depends on boringssl. |
| deps += [ |
| "//third_party/boringssl", |
| ] |
| } else { |
| sources -= [ |
| "extensions/api/networking_private/networking_private_crypto_openssl.cc", |
| ] |
| } |
| deps += [ "//breakpad:client" ] |
| } |
| if (is_mac) { |
| sources += rebase_path( |
| gypi_values.chrome_common_mac_sources, |
| ".", "//chrome") |
| } |
| |
| if (enable_nacl) { |
| deps += [ |
| #'<(DEPTH)/components/nacl.gyp:nacl_common', TODO(GYP) |
| ] |
| } |
| |
| # Printing. |
| if (!enable_basic_printing && !enable_print_preview) { |
| sources -= [ |
| "print_messages.cc", |
| "print_messages.h", |
| ] |
| } else { |
| deps += [ "//printing" ] |
| if (enable_print_preview) { |
| # Full printing support. |
| sources += rebase_path( |
| gypi_values.chrome_common_service_process_sources, |
| ".", "//chrome") |
| } |
| } |
| |
| if (enable_service_discovery) { |
| sources += [ |
| "local_discovery/service_discovery_client.cc", |
| "local_discovery/service_discovery_client.h", |
| ] |
| } |
| if (enable_mdns) { |
| sources += [ |
| "local_discovery/service_discovery_client_impl.cc", |
| "local_discovery/service_discovery_client_impl.h", |
| ] |
| } |
| |
| if (is_android) { |
| sources -= [ |
| "badge_util.cc", |
| "chrome_version_info_posix.cc", |
| "icon_with_badge_image_source.cc", |
| "media_galleries/metadata_types.h", |
| "spellcheck_common.cc", |
| ] |
| } else { |
| # Non-Android. |
| sources += rebase_path( |
| gypi_values.chrome_common_importer_sources, |
| ".", "//chrome") |
| } |
| |
| if (is_chromeos) { |
| sources -= [ "chrome_version_info_posix.cc" ] |
| } |
| |
| if (is_win) { |
| deps += [ "//third_party/wtl" ] |
| } |
| |
| if (enable_mdns) { |
| sources += [ "local_discovery/local_discovery_messages.h" ] |
| } |
| |
| if (is_mac) { |
| sources -= [ |
| "chrome_version_info_posix.cc", |
| ] |
| deps += [ |
| "//third_party/mach_override", |
| "//third_party/google_toolbox_for_mac", |
| ] |
| } |
| |
| if (enable_remoting) { |
| deps += [ "//remoting/client/plugin" ] |
| } |
| if (enable_plugins) { |
| sources += [ |
| "pepper_flash.cc", |
| "pepper_flash.h", |
| "pepper_permission_util.cc", |
| "pepper_permission_util.h", |
| ] |
| deps += [ |
| "//third_party/adobe/flash:flapper_version_h", |
| ] |
| } |
| if (!enable_webrtc) { |
| sources -= [ "media/webrtc_logging_messages.h" ] |
| } |
| if (enable_configuration_policy) { |
| deps += [ "//components/policy" ] |
| } |
| |
| if (safe_browsing_mode == 1) { |
| defines += [ "FULL_SAFE_BROWSING" ] |
| sources += rebase_path( |
| gypi_values.chrome_common_full_safe_browsing_sources, |
| ".", "//chrome") |
| } |
| if (safe_browsing_mode == 2) { |
| defines += [ "MOBILE_SAFE_BROWSING" ] |
| } |
| } |
| |
| import("//chrome/version.gni") |
| process_version("version") { |
| visibility = [ ":common" ] |
| source = "chrome_version_info_values.h.version" |
| output = "$target_gen_dir/chrome_version_info_values.h" |
| } |
| |
| # GN version: chrome/common_constants.gyp:common_constants |
| static_library("constants") { |
| sources = [ |
| "chrome_constants.cc", |
| "chrome_constants.h", |
| "chrome_icon_resources_win.cc", |
| "chrome_icon_resources_win.h", |
| "chrome_paths.cc", |
| "chrome_paths.h", |
| "chrome_paths_android.cc", |
| "chrome_paths_internal.h", |
| "chrome_paths_linux.cc", |
| "chrome_paths_mac.mm", |
| "chrome_paths_win.cc", |
| "chrome_switches.cc", |
| "chrome_switches.h", |
| "env_vars.cc", |
| "env_vars.h", |
| "net/test_server_locations.cc", |
| "net/test_server_locations.h", |
| "pref_font_script_names-inl.h", |
| "pref_font_webkit_names.h", |
| "pref_names.cc", |
| "pref_names.h", |
| "widevine_cdm_constants.cc", |
| "widevine_cdm_constants.h", |
| ] |
| |
| deps = [ |
| "//base", |
| "//base/third_party/dynamic_annotations", |
| "//components/bookmarks/common", |
| "//third_party/widevine/cdm:version_h", |
| ] |
| |
| if (enable_nacl) { |
| deps += [ |
| #'../components/nacl.gyp:nacl_switches', TODO(GYP) |
| ] |
| } |
| } |
| |
| source_set("test_support") { |
| testonly = true |
| visibility = [ "//chrome/test:test_support" ] |
| |
| sources = [ |
| ] |
| |
| deps = [ |
| ":common", |
| "//base", |
| "//testing/gtest", |
| ] |
| |
| if (is_win || is_mac) { |
| sources += [ |
| "media_galleries/picasa_test_util.cc", |
| "media_galleries/picasa_test_util.h", |
| "media_galleries/pmp_test_util.cc", |
| "media_galleries/pmp_test_util.h", |
| ] |
| } |
| |
| if (enable_extensions) { |
| sources += [ |
| "extensions/extension_test_util.cc", |
| "extensions/extension_test_util.h", |
| ] |
| } |
| |
| } |