Commit 7a1da46c authored by brettw@chromium.org's avatar brettw@chromium.org

Make chrome/common compile in GN

Adds extensions common API target and extensions templates.

Adds a number of new targets: widevine, flash, sync proto, metrics proto, device serial.

Minor enhancements to protobuf and mojo templates.

TBR=jamesr

Review URL: https://codereview.chromium.org/343233002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278828 0039d316-1c4b-4281-b951-d872f2087c98
parent 6ffa9ec1
...@@ -22,6 +22,7 @@ group("root") { ...@@ -22,6 +22,7 @@ group("root") {
"//apps/common/api:apps_api", "//apps/common/api:apps_api",
"//cc", "//cc",
"//chrome/common", "//chrome/common",
"//components:all_components",
"//content", "//content",
"//crypto", "//crypto",
"//extensions/common/api:extensions_api", "//extensions/common/api:extensions_api",
......
# 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.
# TODO(brettw) this should maybe be moved to tools/json_schema_compiler/ where
# the script is. Currently, we keep it in the build directory with the gyp
# version to make it easier to find.
#
# Or, considering the fact that it references the chrome/extensions directory,
# it should possibly be moved there.
_api_gen_dir = "//tools/json_schema_compiler"
_api_gen = "$_api_gen_dir/compiler.py"
_impl_dir = "chrome/browser/extensions/api"
_python_files = [
"$_api_gen_dir/cc_generator.py",
"$_api_gen_dir/code.py",
"$_api_gen_dir/compiler.py",
"$_api_gen_dir/cpp_bundle_generator.py",
"$_api_gen_dir/cpp_type_generator.py",
"$_api_gen_dir/cpp_util.py",
"$_api_gen_dir/h_generator.py",
"$_api_gen_dir/idl_schema.py",
"$_api_gen_dir/json_schema.py",
"$_api_gen_dir/model.py",
"$_api_gen_dir/util_cc_helper.py",
]
# Runs the schema compiler over a list of sources.
#
# Parameters:
# sources
# The .json and .idl files to compile.
#
# root_namespace
# The C++ namespace that all generated files go under.
#
# deps, visibility (optional)
template("json_schema_compile") {
assert(defined(invoker.sources), "Need sources for $target_name")
assert(defined(invoker.root_namespace),
"Need root_namespace defined for $target_name")
action_name = "${target_name}_action"
source_set_name = target_name
action_foreach(action_name) {
visibility = ":$source_set_name"
script = _api_gen
source_prereqs = _python_files
sources = invoker.sources
# TODO(GYP) We should probably be using {{source_gen_dir}} instead of
# $target_gen_dir but support for this string isn't pushed out in GN
# binaries yet. Replace this when it is.
outputs = [
"$target_gen_dir/{{source_name_part}}.cc",
"$target_gen_dir/{{source_name_part}}.h",
]
args = [
"--root", rebase_path("//", root_build_dir),
"--destdir", rebase_path(root_gen_dir, root_build_dir),
"--namespace", invoker.root_namespace,
"--generator=cpp",
"--impl-dir", _impl_dir,
"{{source}}",
]
}
source_set(source_set_name) {
if (defined(invoker.visibility)) {
visibility = invoker.visibility
}
sources = get_target_outputs(":$action_name")
deps = [ ":$action_name" ]
if (defined(invoker.deps)) {
deps += invoker.deps
}
}
}
# Runs the schema bundler.
#
# Parameters:
# sources
# The .json and .idl files to bundle.
#
# root_namespace
# The C++ namespace that all generated files go under.
#
# deps, visibility (optional)
template("json_schema_bundle") {
assert(defined(invoker.sources), "Need sources for $target_name")
assert(defined(invoker.root_namespace),
"Need root_namespace defined for $target_name")
action_name = "${target_name}_action"
source_set_name = target_name
action(action_name) {
visibility = ":$source_set_name"
script = _api_gen
source_prereqs = _python_files
source_prereqs += invoker.sources
outputs = [
"$target_gen_dir/generated_api.h",
"$target_gen_dir/generated_api.cc",
"$target_gen_dir/generated_schemas.h",
"$target_gen_dir/generated_schemas.cc",
]
args = [
"--root", rebase_path("//", root_build_dir),
"--destdir", rebase_path(root_gen_dir, root_build_dir),
"--namespace", invoker.root_namespace,
"--generator=cpp-bundle",
"--impl-dir", _impl_dir,
] + rebase_path(invoker.sources, root_build_dir)
}
source_set(source_set_name) {
if (defined(invoker.visibility)) {
visibility = invoker.visibility
}
sources = get_target_outputs(":$action_name")
deps = [ ":$action_name" ]
if (defined(invoker.deps)) {
deps += invoker.deps
}
}
}
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
}, },
'actions': [ 'actions': [
{ {
# GN version: //build/json_schema.gni
# (json_schema_bundle_compile templates)
'action_name': 'genapi_bundle', 'action_name': 'genapi_bundle',
'inputs': [ 'inputs': [
'<(api_gen_dir)/cc_generator.py', '<(api_gen_dir)/cc_generator.py',
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
}, },
'rules': [ 'rules': [
{ {
# GN version: //build/json_schema.gni
# (json_schema_compile template)
'rule_name': 'genapi', 'rule_name': 'genapi',
'msvs_external_rule': 1, 'msvs_external_rule': 1,
'extension': 'json', 'extension': 'json',
......
...@@ -63,6 +63,26 @@ static_library("common") { ...@@ -63,6 +63,26 @@ static_library("common") {
"//ui/resources:resources", "//ui/resources:resources",
"//url", "//url",
] ]
if (!is_ios) {
deps += [
#'<(DEPTH)/apps/common/api/api.gyp:apps_api', TODO(GYP)
"//chrome/common/extensions/api",
#'<(DEPTH)/components/components.gyp:autofill_core_common', TODO(GYP)
#'<(DEPTH)/components/components.gyp:autofill_content_common', TODO(GYP)
#'<(DEPTH)/components/components.gyp:password_manager_core_common', TODO(GYP)
#'<(DEPTH)/components/components.gyp:signin_core_common', TODO(GYP)
#'<(DEPTH)/components/components.gyp:translate_content_common', TODO(GYP)
#'<(DEPTH)/components/nacl.gyp:nacl_common', TODO(GYP)
"//components/visitedlink/common",
#'<(DEPTH)/extensions/common/api/api.gyp:extensions_api', TODO(GYP)
#'<(DEPTH)/extensions/extensions.gyp:extensions_common', TODO(GYP)
"//ipc",
"//third_party/adobe/flash:flapper_version_h",
"//third_party/re2",
"//third_party/widevine/cdm:version_h",
]
}
} }
if (is_linux) { if (is_linux) {
......
# 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("//build/config/features.gni")
import("//build/json_schema.gni")
gypi_values = exec_script(
"//build/gypi_to_gn.py",
[ rebase_path("api.gyp") ],
"scope",
[ "api.gyp" ])
# GYP version: chrome/common/extensions/api/api.gyp:chrome_api
group("api") {
# The GYP version has one target that does both the bundling and compiling
# over the same set of sources. In GN these actions are separate.
deps = [
":api_bundle",
":api_compile",
]
}
# Common sources that are both bundled and compiled.
if (is_android) {
# Should be eliminated. See crbug.com/305852.
schema_sources = gypi_values.android_schema_files
} else {
schema_sources = gypi_values.main_schema_files
if (is_chromeos) {
schema_sources += gypi_values.chromeos_schema_files
if (is_chrome_branded) {
schema_sources += gypi_values.chromeos_branded_schema_files
}
}
if (enable_webrtc) {
schema_sources += gypi_values.webrtc_schema_files
}
}
schema_deps = [
# Different APIs include some headers crom chrome/common that in turn
# include generated headers from these targets.
# TODO(brettw) this should be made unnecessary if possible.
"//components/metrics/proto",
"//device/serial",
"//content/public/browser",
"//skia",
"//sync",
]
if (is_chromeos) {
# deps += [ "<(DEPTH)/chrome/chrome.gyp:drive_proto" ] TODO)GYP)
}
json_schema_bundle("api_bundle") {
visibility = ":api"
sources = schema_sources
if (!is_android) {
sources += gypi_values.main_non_compiled_schema_files
}
root_namespace = "extensions::api"
deps = schema_deps + [ ":api_compile" ]
}
json_schema_compile("api_compile") {
visibility = ":*"
sources = schema_sources
root_namespace = "extensions::api"
deps = schema_deps
}
...@@ -9,135 +9,127 @@ ...@@ -9,135 +9,127 @@
# .gypi reader can not process conditions and does not know about targets, # .gypi reader can not process conditions and does not know about targets,
# etc., it just reads Python dictionaries. # etc., it just reads Python dictionaries.
# #
# In addition, the GN build treats .idl files and .json files separately, # If you add a new category, also add it to the BUILD.gn file in this
# since they run through different scripts. If you add a new category, also # directory.
# add it to the BUILD.gn file in this directory.
'variables': { 'variables': {
# These duplicate other lists and are the only ones used on Android. They # These duplicate other lists and are the only ones used on Android. They
# should be eliminated. See crbug.com/305852. # should be eliminated. See crbug.com/305852.
'android_schema_files_idl': [ 'android_schema_files': [
'file_system.idl',
'sync_file_system.idl',
'tab_capture.idl',
],
'android_schema_files_json': [
'activity_log_private.json', 'activity_log_private.json',
'events.json', 'events.json',
'file_system.idl',
'manifest_types.json', 'manifest_types.json',
'permissions.json', 'permissions.json',
'sync_file_system.idl',
'tab_capture.idl',
'tabs.json', 'tabs.json',
'types.json', 'types.json',
'webview.json',
'web_navigation.json', 'web_navigation.json',
'webview.json',
'windows.json', 'windows.json',
], ],
# These are used everywhere except Android. # These are used everywhere except Android.
'main_schema_files_idl': [ 'main_schema_files': [
'accessibility_private.json',
'activity_log_private.json',
'alarms.idl', 'alarms.idl',
'app_current_window_internal.idl', 'app_current_window_internal.idl',
'app_window.idl', 'app_window.idl',
'audio.idl', 'audio.idl',
'automation_internal.idl',
'automation.idl', 'automation.idl',
'automation_internal.idl',
'autotest_private.idl', 'autotest_private.idl',
'bluetooth.idl', 'bluetooth.idl',
'bluetooth_low_energy.idl', 'bluetooth_low_energy.idl',
'bluetooth_private.json',
'bluetooth_socket.idl', 'bluetooth_socket.idl',
'browser.idl', 'bookmark_manager_private.json',
'bookmarks.json',
'braille_display_private.idl', 'braille_display_private.idl',
'browser.idl',
'cast_channel.idl', 'cast_channel.idl',
'cloud_print_private.json',
'command_line_private.json',
'content_settings.json',
'context_menus_internal.json',
'context_menus.json',
'cookies.json',
'debugger.json',
'desktop_capture.json',
'developer_private.idl', 'developer_private.idl',
'dial.idl', 'dial.idl',
'downloads.idl', 'downloads.idl',
'downloads_internal.idl', 'downloads_internal.idl',
'echo_private.json',
'enterprise_platform_keys_private.json',
'events.json',
'feedback_private.idl', 'feedback_private.idl',
'file_browser_private.idl', 'file_browser_private.idl',
'file_browser_private_internal.idl', 'file_browser_private_internal.idl',
'file_system.idl', 'file_system.idl',
'file_system_provider.idl', 'file_system_provider.idl',
'file_system_provider_internal.idl', 'file_system_provider_internal.idl',
'font_settings.json',
'gcd_private.idl', 'gcd_private.idl',
'gcm.json',
'guest_view_internal.json',
'hangouts_private.idl', 'hangouts_private.idl',
'hid.idl', 'hid.idl',
'history.json',
'hotword_private.idl', 'hotword_private.idl',
'i18n.json',
'identity.idl', 'identity.idl',
'identity_private.idl', 'identity_private.idl',
'idle.json',
'image_writer_private.idl', 'image_writer_private.idl',
'input_ime.json',
'location.idl', 'location.idl',
'management.json',
'manifest_types.json',
'mdns.idl', 'mdns.idl',
'media_galleries.idl', 'media_galleries.idl',
'media_galleries_private.idl', 'media_galleries_private.idl',
'metrics_private.json',
'networking_private.json',
'notifications.idl', 'notifications.idl',
'omnibox.json',
'page_capture.json',
'permissions.json',
'power.idl', 'power.idl',
'preferences_private.json',
'push_messaging.idl', 'push_messaging.idl',
'reading_list_private.json',
'screenlock_private.idl', 'screenlock_private.idl',
'serial.idl', 'serial.idl',
'sessions.json',
'signed_in_devices.idl', 'signed_in_devices.idl',
'streams_private.idl', 'streams_private.idl',
'sync_file_system.idl',
'synced_notifications_private.idl', 'synced_notifications_private.idl',
'sync_file_system.idl',
'system_cpu.idl', 'system_cpu.idl',
'system_display.idl', 'system_display.idl',
'system_indicator.idl', 'system_indicator.idl',
'system_memory.idl', 'system_memory.idl',
'system_network.idl', 'system_network.idl',
'system_private.json',
'system_storage.idl', 'system_storage.idl',
'tab_capture.idl', 'tab_capture.idl',
# Despite the name, this API does not rely on any
# WebRTC-specific bits and as such does not belong in
# the enable_webrtc=0 section below.
'webrtc_audio_private.idl',
'webrtc_logging_private.idl',
],
'main_schema_files_json': [
'accessibility_private.json',
'activity_log_private.json',
'bluetooth_private.json',
'bookmark_manager_private.json',
'bookmarks.json',
'cloud_print_private.json',
'command_line_private.json',
'content_settings.json',
'context_menus.json',
'context_menus_internal.json',
'cookies.json',
'debugger.json',
'desktop_capture.json',
'echo_private.json',
'enterprise_platform_keys_private.json',
'events.json',
'font_settings.json',
'gcm.json',
'guest_view_internal.json',
'history.json',
'i18n.json',
'idle.json',
'input_ime.json',
'management.json',
'manifest_types.json',
'metrics_private.json',
'networking_private.json',
'omnibox.json',
'page_capture.json',
'permissions.json',
'preferences_private.json',
'reading_list_private.json',
'sessions.json',
'system_private.json',
'tabs.json', 'tabs.json',
'terminal_private.json', 'terminal_private.json',
'types.json', 'types.json',
'virtual_keyboard_private.json', 'virtual_keyboard_private.json',
'web_navigation.json', 'web_navigation.json',
'web_request.json', 'web_request.json',
# Despite the name, this API does not rely on any
# WebRTC-specific bits and as such does not belong in
# the enable_webrtc=0 section below.
'webrtc_audio_private.idl',
'webrtc_logging_private.idl',
'webstore_private.json', 'webstore_private.json',
'webview.json', 'webview.json',
'windows.json', 'windows.json',
], ],
# The non-compiled shcema files don't need to be separated out by type
# since they're only given to the bundle script which doesn't care about
# type.
'main_non_compiled_schema_files': [ 'main_non_compiled_schema_files': [
'browsing_data.json', 'browsing_data.json',
'chromeos_info_private.json', 'chromeos_info_private.json',
...@@ -152,25 +144,23 @@ ...@@ -152,25 +144,23 @@
], ],
# ChromeOS-specific schemas. # ChromeOS-specific schemas.
'chromeos_schema_files_idl': [ 'chromeos_schema_files': [
'accessibility_features.json',
'diagnostics.idl', 'diagnostics.idl',
'enterprise_platform_keys.idl', 'enterprise_platform_keys.idl',
'enterprise_platform_keys_internal.idl', 'enterprise_platform_keys_internal.idl',
'log_private.idl',
'webcam_private.idl',
],
'chromeos_schema_files_json': [
'accessibility_features.json',
'file_browser_handler_internal.json', 'file_browser_handler_internal.json',
'first_run_private.json', 'first_run_private.json',
'log_private.idl',
'wallpaper.json', 'wallpaper.json',
'wallpaper_private.json', 'wallpaper_private.json',
'webcam_private.idl',
], ],
'chromeos_branded_schema_files_idl': [ 'chromeos_branded_schema_files': [
'ledger/ledger.idl', 'ledger/ledger.idl',
], ],
'webrtc_schema_files_idl': [ 'webrtc_schema_files': [
'cast_streaming_rtp_stream.idl', 'cast_streaming_rtp_stream.idl',
'cast_streaming_session.idl', 'cast_streaming_session.idl',
'cast_streaming_udp_transport.idl', 'cast_streaming_udp_transport.idl',
...@@ -178,6 +168,7 @@ ...@@ -178,6 +168,7 @@
}, },
'targets': [ 'targets': [
{ {
# GN version: //chrome/common/extensions/api:api
'target_name': 'chrome_api', 'target_name': 'chrome_api',
'type': 'static_library', 'type': 'static_library',
'sources': [ 'sources': [
...@@ -199,32 +190,29 @@ ...@@ -199,32 +190,29 @@
'<@(main_non_compiled_schema_files)', '<@(main_non_compiled_schema_files)',
], ],
'schema_files': [ 'schema_files': [
'<@(main_schema_files_idl)', '<@(main_schema_files)',
'<@(main_schema_files_json)',
], ],
}, { # OS=="android" }, { # OS=="android"
'non_compiled_schema_files': [ 'non_compiled_schema_files': [
], ],
'schema_files': [ 'schema_files': [
# These should be eliminated. See crbug.com/305852. # These should be eliminated. See crbug.com/305852.
'<@(android_schema_files_idl)', '<@(android_schema_files)',
'<@(android_schema_files_json)',
], ],
}], }],
['chromeos==1', { ['chromeos==1', {
'schema_files': [ 'schema_files': [
'<@(chromeos_schema_files_idl)', '<@(chromeos_schema_files)',
'<@(chromeos_schema_files_json)',
], ],
}], }],
['enable_webrtc==1', { ['enable_webrtc==1', {
'schema_files': [ 'schema_files': [
'<@(webrtc_schema_files_idl)', '<@(webrtc_schema_files)',
], ],
}], }],
['branding=="Chrome" and chromeos==1', { ['branding=="Chrome" and chromeos==1', {
'schema_files': [ 'schema_files': [
'<@(chromeos_branded_schema_files_idl)', '<@(chromeos_branded_schema_files)',
], ],
}], }],
], ],
...@@ -232,6 +220,12 @@ ...@@ -232,6 +220,12 @@
'root_namespace': 'extensions::api', 'root_namespace': 'extensions::api',
}, },
'dependencies': [ 'dependencies': [
# Different APIs include some headers crom chrome/common that in turn
# include generated headers from these targets.
# TODO(brettw) this should be made unnecessary if possible.
'<(DEPTH)/components/components.gyp:component_metrics_proto',
'<(DEPTH)/device/serial/serial.gyp:device_serial',
'<(DEPTH)/content/content.gyp:content_browser', '<(DEPTH)/content/content.gyp:content_browser',
'<(DEPTH)/skia/skia.gyp:skia', '<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/sync/sync.gyp:sync', '<(DEPTH)/sync/sync.gyp:sync',
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Collection of all components. You wouldn't link to this, but this is rather # Collection of all components. You wouldn't link to this, but this is rather
# to reference the files so they can be compiled by the build system. # to reference the files so they can be compiled by the build system.
group("all") { group("all_components") {
visibility = "//:*" # Only for the root targets to bring in. visibility = "//:*" # Only for the root targets to bring in.
deps = [ deps = [
......
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
}, },
{ {
# Protobuf compiler / generator for UMA (User Metrics Analysis). # Protobuf compiler / generator for UMA (User Metrics Analysis).
#
# GN version: //component/metrics/proto:proto
'target_name': 'component_metrics_proto', 'target_name': 'component_metrics_proto',
'type': 'static_library', 'type': 'static_library',
'sources': [ 'sources': [
......
# 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("//third_party/protobuf/proto_library.gni")
# GYP version: components/
proto_library("proto") {
sources = [
"chrome_user_metrics_extension.proto",
"histogram_event.proto",
"omnibox_event.proto",
"omnibox_input_type.proto",
"perf_data.proto",
"profiler_event.proto",
"sampled_profile.proto",
"system_profile.proto",
"user_action_event.proto",
]
}
# 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("//mojo/public/tools/bindings/mojom.gni")
# GYP version: device/serial/serial.gyp:device_serial
static_library("serial") {
output_name = "device_serial"
sources = [
"serial_device_enumerator.cc",
"serial_device_enumerator.h",
"serial_device_enumerator_linux.cc",
"serial_device_enumerator_linux.h",
"serial_device_enumerator_mac.cc",
"serial_device_enumerator_mac.h",
"serial_device_enumerator_win.cc",
"serial_device_enumerator_win.h",
]
if (is_linux) {
configs += [ "//build/config/linux:udev" ]
}
deps = [
":serial_mojo",
]
}
mojom("serial_mojo") {
visibility = ":serial"
sources = [
"serial.mojom",
]
}
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
}, },
'targets': [ 'targets': [
{ {
# GN version: //device/serial
'target_name': 'device_serial', 'target_name': 'device_serial',
'type': 'static_library', 'type': 'static_library',
'include_dirs': [ 'include_dirs': [
......
...@@ -77,6 +77,9 @@ template("mojom") { ...@@ -77,6 +77,9 @@ template("mojom") {
} }
source_set(target_name) { source_set(target_name) {
if (defined(invoker.visibility)) {
visibility = invoker.visibility
}
sources = process_file_template(invoker.sources, generator_cpp_outputs) sources = process_file_template(invoker.sources, generator_cpp_outputs)
data = process_file_template(invoker.sources, generator_js_outputs) data = process_file_template(invoker.sources, generator_js_outputs)
deps = [ deps = [
......
# 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.
# TODO(GYP) This exists as a stub to compile the sync protobuf so dependent
# targets will compile. This target will have to be written completely for
# such things to link, however.
group("sync") {
deps = [
"//sync/protocol",
]
}
# 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("//third_party/protobuf/proto_library.gni")
proto_library("protocol") {
sources = [
"app_notification_specifics.proto",
"app_setting_specifics.proto",
"app_specifics.proto",
"app_list_specifics.proto",
"article_specifics.proto",
"attachments.proto",
"autofill_specifics.proto",
"bookmark_specifics.proto",
"client_commands.proto",
"client_debug_info.proto",
"device_info_specifics.proto",
"dictionary_specifics.proto",
"encryption.proto",
"experiments_specifics.proto",
"extension_setting_specifics.proto",
"extension_specifics.proto",
"favicon_image_specifics.proto",
"favicon_tracking_specifics.proto",
"get_updates_caller_info.proto",
"history_delete_directive_specifics.proto",
"nigori_specifics.proto",
"managed_user_setting_specifics.proto",
"managed_user_shared_setting_specifics.proto",
"managed_user_specifics.proto",
"password_specifics.proto",
"preference_specifics.proto",
"priority_preference_specifics.proto",
"search_engine_specifics.proto",
"session_specifics.proto",
"sync.proto",
"sync_enums.proto",
"synced_notification_app_info_specifics.proto",
"synced_notification_data.proto",
"synced_notification_render.proto",
"synced_notification_specifics.proto",
"test.proto",
"theme_specifics.proto",
"typed_url_specifics.proto",
"unique_position.proto",
]
cc_generator_options = "dllexport_decl=SYNC_EXPORT:"
cc_include = "sync/base/sync_export.h"
defines = [ "SYNC_IMPLEMENTATION" ]
extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
}
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
# The sync protocol buffer library. # The sync protocol buffer library.
{ {
# GN version: //sync/protocol
'target_name': 'sync_proto', 'target_name': 'sync_proto',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, }, 'variables': { 'enable_wexit_time_destructors': 1, },
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
'SYNC_IMPLEMENTATION', 'SYNC_IMPLEMENTATION',
], ],
'sources': [ 'sources': [
# NOTE: If you add a file to this list, also add it to
# sync/protocol/BUILD.gn
'protocol/app_notification_specifics.proto', 'protocol/app_notification_specifics.proto',
'protocol/app_setting_specifics.proto', 'protocol/app_setting_specifics.proto',
'protocol/app_specifics.proto', 'protocol/app_specifics.proto',
......
# 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.
if (is_chrome_branded) {
if (is_linux && cpu_arch == "x86") {
flapper_version_h_file = "symbols/ppapi/linux/flapper_version.h"
flapper_binary_files = [
"binaries/ppapi/linux/libpepflashplayer.so",
"binaries/ppapi/linux/manifest.json",
]
} else if (is_linux && cpu_arch == "x64") {
flapper_version_h_file = "symbols/ppapi/linux_x64/flapper_version.h"
flapper_binary_files = [
"binaries/ppapi/linux_x64/libpepflashplayer.so",
"binaries/ppapi/linux_x64/manifest.json",
]
} else if (is_mac && cpu_arch == "x86") {
flapper_version_h_file = "symbols/ppapi/mac/flapper_version.h"
flapper_binary_files = [
"binaries/ppapi/mac/PepperFlashPlayer.plugin",
"binaries/ppapi/mac/manifest.json",
]
} else if (is_mac && cpu_arch == "x64") {
flapper_version_h_file = "symbols/ppapi/mac_64/flapper_version.h"
flapper_binary_files = [
"binaries/ppapi/mac_64/PepperFlashPlayer.plugin",
"binaries/ppapi/mac_64/manifest.json",
]
} else if (is_win && cpu_arch == "x86") {
flapper_version_h_file = "symbols/ppapi/win/flapper_version.h"
flapper_binary_files = [
"binaries/ppapi/win/pepflashplayer.dll",
"binaries/ppapi/win/manifest.json",
]
} else if (is_win && cpu_arch == "x64") {
flapper_version_h_file = "symbols/ppapi/win_x64/flapper_version.h"
flapper_binary_files = [
"binaries/ppapi/win_x64/pepflashplayer.dll",
"binaries/ppapi/win_x64/manifest.json",
]
} else {
flapper_version_h_file = "flapper_version.h"
flapper_binary_files = []
}
} else {
flapper_version_h_file = "flapper_version.h"
flapper_binary_files = []
}
copy("flapper_version_h") {
sources = [ flapper_version_h_file ]
outputs = [ "$root_gen_dir/{{source_file_part}}" ]
}
if (flapper_binary_files == []) {
group("flapper_binaries") {
# NOP
}
} else {
copy("flapper_binaries") {
sources = flapper_binary_files
outputs = [ "$root_out_dir/PepperFlash/{{source_file_part}}" ]
}
}
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
# anything to be done in this file (instead of a higher-level .gyp file). # anything to be done in this file (instead of a higher-level .gyp file).
'targets': [ 'targets': [
{ {
# GN version: //third_party/adobe/flash:flapper_version_h
'target_name': 'flapper_version_h', 'target_name': 'flapper_version_h',
'type': 'none', 'type': 'none',
'copies': [{ 'copies': [{
...@@ -67,6 +68,7 @@ ...@@ -67,6 +68,7 @@
}], }],
}, },
{ {
# GN version: //third_party/adobe/flash:flapper_binaries
'target_name': 'flapper_binaries', 'target_name': 'flapper_binaries',
'type': 'none', 'type': 'none',
'copies': [{ 'copies': [{
......
...@@ -4,22 +4,41 @@ ...@@ -4,22 +4,41 @@
# Compile a protocol buffer. # Compile a protocol buffer.
# #
# The 'proto_in_dir' variable is the path to the directory containing the # Protobuf parameters:
# .proto files. If left out, it defaults to '.'.
# #
# The 'proto_out_dir' variable specifies the path suffix that output files are # proto_in_dir (optional)
# generated under. Targets that gyp-depend on my_proto_lib will be able to # The path to the directory containing the .proto files. If left out, it
# include the resulting proto headers with an include like: # defaults to '.'.
# #include "dir/for/my_proto_lib/foo.pb.h"
# If undefined, this defaults to matching the input directory.
# #
# If you need to add an EXPORT macro to a protobuf's C++ header, set the # proto_out_dir (optional)
# 'cc_generator_options' variable with the value: 'dllexport_decl=FOO_EXPORT:' # Specifies the path suffix that output files are generated under.
# e.g. 'dllexport_decl=BASE_EXPORT:' # Targets that gyp-depend on my_proto_lib will be able to include the
# resulting proto headers with an include like:
# #include "dir/for/my_proto_lib/foo.pb.h"
# If undefined, this defaults to matching the input directory.
# #
# It is likely you also need to #include a file for the above EXPORT macro to # cc_generator_options (optional)
# work. You can do so with the 'cc_include' variable. # List of extra flags passed to the protocol compiler. If you need to
# e.g. 'base/base_export.h' # add an EXPORT macro to a protobuf's C++ header, set the
# 'cc_generator_options' variable with the value:
# 'dllexport_decl=FOO_EXPORT:' (note trailing colon).
#
# It is likely you also need to #include a file for the above EXPORT
# macro to work. See cc_include.
#
# cc_include (optional)
# String listing an extra include that should be passed.
# Example: cc_include = "foo/bar.h"
#
# Parameters for compiling the generated code:
#
# defines (optional)
# Defines to supply to the source set that compiles the generated source
# code.
#
# extra_configs (optional)
# A list of config labels that will be appended to the configs applying
# to the source set.
# #
# Example: # Example:
# proto_library("mylib") { # proto_library("mylib") {
...@@ -115,6 +134,13 @@ template("proto_library") { ...@@ -115,6 +134,13 @@ template("proto_library") {
sources = get_target_outputs(":$action_name") sources = get_target_outputs(":$action_name")
if (defined(invoker.defines)) {
defines = invoker.defines
}
if (defined(invoker.extra_configs)) {
configs += invoker.extra_configs
}
direct_dependent_configs = [ "//third_party/protobuf:using_proto" ] direct_dependent_configs = [ "//third_party/protobuf:using_proto" ]
deps = [ deps = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment