diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-20 22:16:30 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-20 22:18:05 +0000 |
commit | 55699f3922240d6fb09ae7cda583687971111670 (patch) | |
tree | 2404618dc3620c64578d73b38c09e0c271f537a8 /chrome | |
parent | 2d7c37bdeac0c991eab19ef5916438ba796946b5 (diff) | |
download | chromium_src-55699f3922240d6fb09ae7cda583687971111670.zip chromium_src-55699f3922240d6fb09ae7cda583687971111670.tar.gz chromium_src-55699f3922240d6fb09ae7cda583687971111670.tar.bz2 |
Add chrome, installer_util targets to GN build.
The chrome target doesn't link yet so is currently a source set.
This adds some installer util targets and some related targets, as well as fixes up some TODOs referencing completed targets.
Fixes and enables the snapshot unit test.
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/489223002
Cr-Commit-Position: refs/heads/master@{#290927}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/BUILD.gn | 93 | ||||
-rw-r--r-- | chrome/browser/BUILD.gn | 53 | ||||
-rw-r--r-- | chrome/browser/extensions/BUILD.gn | 12 | ||||
-rw-r--r-- | chrome/browser/ui/BUILD.gn | 6 | ||||
-rw-r--r-- | chrome/chrome.gyp | 1 | ||||
-rw-r--r-- | chrome/chrome_exe.gypi | 1 | ||||
-rw-r--r-- | chrome/chrome_installer.gypi | 1 | ||||
-rw-r--r-- | chrome/chrome_installer_util.gypi | 2 | ||||
-rw-r--r-- | chrome/common/BUILD.gn | 41 | ||||
-rw-r--r-- | chrome/installer/util/BUILD.gn | 53 | ||||
-rw-r--r-- | chrome/renderer/BUILD.gn | 8 | ||||
-rw-r--r-- | chrome/version.gni | 60 |
12 files changed, 259 insertions, 72 deletions
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 421b42f..04d37bb 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -4,6 +4,87 @@ import("//build/config/features.gni") import("//build/config/ui.gni") +import("//chrome/version.gni") + +# TODO(GYP) for Windows need to the the reorder-imports step which probably +# means adding another target and renaming this to chrome_initial like in GYP. +#executable("chrome") { # TODO(GYP) enable once this links. +source_set("chrome") { + # Because the sources list varies so significantly per-platform, generally + # each platform lists its own files rather than relying on filtering or + # removing unused files. + sources = [ + "app/chrome_exe_resource.h", + "//content/public/common/content_switches.cc", + ] + deps = [] + + # TODO(GYP) mac_bundle_resources, xcode_settings + + # TODO(GYP) order_profiling, order_text_section + + if (is_win) { + sources += [ + "app/chrome_exe_main_win.cc", + "app/client_util.cc", + "app/client_util.h", + "app/signature_validator_win.cc", + "app/signature_validator_win.h", + "//content/app/startup_helper_win.cc", + ] + deps += [ "//ui/gfx" ] + } else if (use_aura) { + # Non-Windows aura entrypoint. + sources += [ "app/chrome_exe_main_aura.cc" ] + } + + if (is_linux) { + # TODO(GYP) manpage action + + sources += [ + "app/chrome_dll_resource.h", + "app/chrome_main.cc", + "app/chrome_main_delegate.cc", + "app/chrome_main_delegate.h", + ] + + deps += [ + # On Linux, link the dependencies (libraries) that make up actual + # Chromium functionality directly into the executable. + ":browser_dependencies", + ":child_dependencies", + + "//base/allocator", + # Needed to use the master_preferences functions + "//chrome/installer/util", + "//content/app:both", + ] + + # Needed for chrome_main.cc initialization of libraries. + configs += [ "//build/config/linux:pangocairo" ] + + # TODO(GYP) ['profiling==0 and linux_disable_pie==0', { + # 'ldflags': [ + # '-pie', + # ], + #}], + + if (use_x11) { + configs += [ + "//build/config/linux:x11", + "//build/config/linux:xext", + ] + } + } + + if (is_mac) { + sources += [ + "app/chrome_exe_main_mac.cc", + ] + } + # TODO(GYP) is_mac + +} shared_library("main_dll") { configs += [ "//build/config/compiler:wexit_time_destructors" ] @@ -128,6 +209,18 @@ group("child_dependencies") { } } +if (is_win) { + # TODO(brettw) this duplicates "//chrome/common:version" which applies to + # Linux. + process_version("version_header") { + visibility = ":*" + source = "version.h.in" + # TODO(brettw) this should move to $target_gen_dir/version.h and + # source files including it should reference it via "chrome/version.h" + output = "$root_gen_dir/version.h" + } +} + # GYP version: chrome/chrome_resources.gyp:chrome_resources group("resources") { deps = [ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 77ce56b..8d8bd36 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -138,11 +138,17 @@ static_library("browser") { deps += [ "//cc", + "//chrome/browser/devtools", "//chrome/browser/performance_monitor", "//chrome/common/extensions/api:api", + "//chrome/installer/util", "//components/autofill/content/browser", "//components/dom_distiller/content", "//components/keyed_service/content", + "//components/navigation_interception", + "//components/password_manager/content/browser", + "//components/precache/content", + "//components/sessions", "//components/storage_monitor", "//components/translate/content/browser", "//components/url_matcher", @@ -150,6 +156,8 @@ static_library("browser") { "//components/visitedlink/browser", "//components/visitedlink/common", "//components/web_modal", + "//media", + "//media/cast:net", "//mojo/environment:chromium", "//mojo/public/cpp/bindings", "//mojo/public/js/bindings", @@ -172,20 +180,11 @@ static_library("browser") { "//webkit/common", "//webkit/common:storage", "//webkit/glue/resources", - # TODO(GYP) - #"apps", - #"debugger", - #"installer_util", - #"../components/components.gyp:navigation_interception", - #"../components/components.gyp:password_manager_content_browser", - #"../components/components.gyp:precache_content", - #"../components/components.gyp:sessions", - #"../media/cast/cast.gyp:cast_transport", - #"../media/media.gyp:media", + #"apps", TODO(GYP) ## TODO(tonyg): Remove this dependency (crbug.com/280157). - #"../testing/perf/perf_test.gyp:*", + #"../testing/perf/perf_test.gyp:*", TODO(GYP) # Note: for this one also remove the webrtc_stub_config - #"../third_party/webrtc/modules/modules.gyp:desktop_capture", + #"../third_party/webrtc/modules/modules.gyp:desktop_capture", TODO(GYP) ] } else { # iOS sources += rebase_path(gypi_values.chrome_browser_ios_sources, @@ -387,8 +386,8 @@ static_library("browser") { "//chrome/app/chrome_breakpad_client.h", ] deps += [ - #"../components/components.gyp:breakpad_component", TODO(GYP) - #"../components/components.gyp:breakpad_host", TODO(GYP) + "//components/breakpad/app", + "//components/breakpad/browser", ] } if (use_nss_certs) { @@ -414,7 +413,7 @@ static_library("browser") { sources += rebase_path(gypi_values.chrome_browser_basic_printing_sources, ".", "//chrome") deps += [ - #"../printing/printing.gyp:printing", TODO(GYP) + "//printing", ] if (is_win && win_pdf_metafile_for_printing) { sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources, @@ -454,7 +453,7 @@ static_library("browser") { sources += rebase_path(gypi_values.chrome_browser_android_sources, ".", "//chrome") deps += [ - #"../components/components.gyp:cdm_browser", TODO(GYP) + "//components/cdm/browser", #"../components/components.gyp:web_contents_delegate_android", TODO(GYP) #"chrome_browser_jni_headers", TODO(GYP) ] @@ -505,24 +504,24 @@ static_library("browser") { sources += rebase_path(gypi_values.chrome_browser_win_sources, ".", "//chrome") deps += [ + "//chrome:version_header", + "//chrome/installer/util:strings", + "//third_party/iaccessible2", + "//third_party/isimpledom", "//third_party/wtl", + "//ui/views", + "//ui/views/controls/webview", #"chrome_process_finder", TODO(GYP) - #"installer_util_strings", TODO(GYP) - #"../chrome/chrome.gyp:chrome_version_header", TODO(GYP) #"../chrome_elf/chrome_elf.gyp:chrome_elf", TODO(GYP) #"../chrome_elf/chrome_elf.gyp:chrome_elf_constants", TODO(GYP) #"../chrome_elf/chrome_elf.gyp:dll_hash", TODO(GYP) #"../google_update/google_update.gyp:google_update", TODO(GYP) - #"../third_party/iaccessible2/iaccessible2.gyp:iaccessible2", TODO(GYP) - #"../third_party/isimpledom/isimpledom.gyp:isimpledom", TODO(GYP) #"../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages", TODO(GYP) - #"../ui/views/controls/webview/webview.gyp:webview", TODO(GYP) - #"../ui/views/views.gyp:views", TODO(GYP) #"../win8/win8.gyp:metro_viewer", TODO(GYP) ] forward_dependent_configs_from += [ - #"../ui/views/controls/webview/webview.gyp:webview", TODO(GYP) - #"../ui/views/views.gyp:views", TODO(GYP) + "//ui/views", + "//ui/views/controls/webview", ] } else { # Non-Windows. @@ -530,8 +529,8 @@ static_library("browser") { ".", "//chrome") if (toolkit_views) { deps += [ - #"../ui/views/controls/webview/webview.gyp:webview", TODO(GYP) - #"../ui/views/views.gyp:views", TODO(GYP) + "//ui/views", + "//ui/views/controls/webview", ] # TODO(GYP) why is this needed? Very susicious. # "include_dirs": [ @@ -569,7 +568,7 @@ static_library("browser") { } if (enable_app_list) { deps += [ - #"../ui/app_list/app_list.gyp:app_list", TODO(GYP) + "//ui/app_list", ] } if (enable_managed_users) { diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index a376028..d8b196c 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn @@ -35,18 +35,24 @@ static_library("extensions") { "//chrome:strings", "//chrome/app/resources:platform_locale_settings", "//chrome/app/theme:theme_resources", + "//chrome/browser/devtools", "//chrome/browser/history:in_memory_url_index_cache_proto", "//chrome/common", "//chrome/common/extensions/api", "//chrome/common/net", "//chrome/common/safe_browsing:proto", + "//chrome/installer/util", "//components/copresence", + "//components/omaha_query_params", "//components/onc", "//components/strings", "//components/url_matcher", "//content/public/browser", "//content/public/common", "//crypto", + "//device/bluetooth", + "//device/hid", + "//extensions/browser", "//extensions/common/api", "//extensions/strings", "//net", @@ -67,12 +73,6 @@ static_library("extensions") { "//webkit/browser:storage", "//webkit/common:storage", "//webkit/glue/resources", - #"debugger", TODO(GYP) - #"installer_util", TODO(GYP) - #"../components/components.gyp:omaha_query_params", TODO(GYP) - #'../device/bluetooth/bluetooth.gyp:device_bluetooth', TODO(GYP) - #"../device/hid/hid.gyp:device_hid", TODO(GYP) - #"../extensions/extensions.gyp:extensions_browser", TODO(GYP) #"../third_party/webrtc/modules/modules.gyp:desktop_capture", TODO(GYP) ] diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 8ff2c16..a1d4ed7 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn @@ -82,9 +82,11 @@ static_library("ui") { sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources, ".", "//chrome") deps += [ + "//chrome/browser/devtools", "//chrome/browser/performance_monitor", "//chrome/browser/ui/webui/omnibox:mojo_bindings", "//chrome/common/extensions/api:api", + "//chrome/installer/util", "//components/autofill/content/browser:risk_proto", "//device/bluetooth", "//device/nfc", @@ -106,8 +108,6 @@ static_library("ui") { "//webkit/common", "//webkit/common:storage", "//webkit/glue/resources", - #'debugger', TODO(GYP) - #'installer_util', TODO(GYP) #'../third_party/libjingle/libjingle.gyp:libjingle', TODO(GYP) ] # TODO(GYP) @@ -310,13 +310,13 @@ static_library("ui") { sources += rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome") deps += [ + "//chrome/browser/installer/util:strings", "//third_party/wtl", "//third_party/iaccessible2", "//third_party/isimpledom", "//ui/app_list", "//ui/views", "//ui/views/controls/webview", - #'installer_util_strings', TODO(GYP) #'metro_utils', TODO(GYP) #'../google_update/google_update.gyp:google_update', TODO(GYP) ] diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 552d0ed..545d1bf 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -480,6 +480,7 @@ ], }, { + # GN version: //chrome:version_header 'target_name': 'chrome_version_header', 'type': 'none', 'hard_dependency': 1, diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi index fe9eb31..418f0f1 100644 --- a/chrome/chrome_exe.gypi +++ b/chrome/chrome_exe.gypi @@ -47,6 +47,7 @@ ], }, { + # GN version: //chrome 'target_name': 'chrome_initial', 'type': 'executable', # Name the exe chrome.exe, not chrome_initial.exe. diff --git a/chrome/chrome_installer.gypi b/chrome/chrome_installer.gypi index 0ff518c..435c592 100644 --- a/chrome/chrome_installer.gypi +++ b/chrome/chrome_installer.gypi @@ -150,6 +150,7 @@ 'msvs_disabled_warnings': [ 4267, ], }, { + # GN version: //chrome/installer/util:strings 'target_name': 'installer_util_strings', 'type': 'none', 'actions': [ diff --git a/chrome/chrome_installer_util.gypi b/chrome/chrome_installer_util.gypi index ef981c1..2c45db6 100644 --- a/chrome/chrome_installer_util.gypi +++ b/chrome/chrome_installer_util.gypi @@ -209,6 +209,7 @@ ['OS!="win"', { 'targets': [ { + # GN version: //chrome/installer/util 'target_name': 'installer_util', 'type': 'static_library', 'dependencies': [ @@ -217,6 +218,7 @@ '<(DEPTH)/chrome/chrome_resources.gyp:chrome_strings', ], 'sources': [ + # Note: sources list duplicated in GN build. 'installer/util/google_update_experiment_util.cc', 'installer/util/google_update_experiment_util.h', 'installer/util/master_preferences.cc', diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index c914632..1903837 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn @@ -52,6 +52,7 @@ static_library("common") { "//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", @@ -63,6 +64,7 @@ static_library("common") { "//crypto", "//extensions:extensions_resources", "//extensions/strings", + "//media/cast:net", "//net", "//skia", "//third_party/icu", @@ -71,8 +73,6 @@ static_library("common") { "//third_party/zlib:zip", "//ui/resources:resources", "//url", - #":installer_util", TODO(GYP) - #"//media/cast/cast.gyp:cast_transport", TODO(GYP) ] if (is_ios) { @@ -90,12 +90,12 @@ static_library("common") { "//components/password_manager/core/common", "//components/signin/core/common", "//components/translate/content/common", + "//extensions/common", "//extensions/common/api", "//ipc", "//third_party/adobe/flash:flapper_version_h", "//third_party/re2", "//third_party/widevine/cdm:version_h", - #'<(DEPTH)/extensions/extensions.gyp:extensions_common', TODO(GYP) ] } @@ -232,36 +232,13 @@ static_library("common") { } if (is_linux) { - action("version") { + # TODO(brettw) this duplicates "//chrome/common:version" which applies to + # Windows. + import("//chrome/version.gni") + process_version("version") { visibility = ":common" - script = "//build/util/version.py" - - lastchange_path = "//build/util/LASTCHANGE" - version_path = "//chrome/VERSION" - template_input_path = "chrome_version_info_posix.h.version" - if (is_chrome_branded) { - branding_path = "//chrome/app/theme/google_chrome/BRANDING" - } else { - branding_path = "//chrome/app/theme/chromium/BRANDING" - } - - inputs = [ - version_path, - template_input_path, - lastchange_path, - branding_path, - ] - - outfile = "$target_gen_dir/chrome_version_info_posix.h" - outputs = [ outfile ] - - args = [ - "-f", rebase_path(version_path, root_build_dir), - "-f", rebase_path(branding_path, root_build_dir), - "-f", rebase_path(lastchange_path, root_build_dir), - rebase_path(template_input_path, root_build_dir), - rebase_path(outfile, root_build_dir), - ] + source = "chrome_version_info_posix.h.version" + output = "$target_gen_dir/chrome_version_info_posix.h" } } else { # Other platforms have a different way to do versioning. diff --git a/chrome/installer/util/BUILD.gn b/chrome/installer/util/BUILD.gn new file mode 100644 index 0000000..d01040e --- /dev/null +++ b/chrome/installer/util/BUILD.gn @@ -0,0 +1,53 @@ +# 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. + +static_library("util") { + deps = [ + "//base", + "//chrome:resources", + "//chrome:strings", + ] + + if (is_win) { + # TODO(GYP) installer_util on Windows. + # This is a bit tricky. It seems that what's currently called + # installer_util_nacl_win64 should be a different target with a different + # name ("installer_util_minimal"?) since it's not strictly the 64-bit build + # of that target. + } else { + sources = [ + "google_update_experiment_util.cc", + "google_update_experiment_util.h", + "master_preferences.cc", + "master_preferences.h", + "master_preferences_constants.cc", + "master_preferences_constants.h", + ] + } +} + +action("strings") { + script = "prebuild/create_string_rc.py" + + if (is_chrome_branded) { + grdfile = "//chrome/app/google_chrome_strings.grd" + } else { + grdfile = "//chrome/app/chromium_strings.grd" + } + + inputs = [ grdfile ] + + # TODO(brettw) move to target_gen_dir + outdir = "$root_gen_dir/installer_util_strings" + outputs = [ + "$outdir/installer_util_strings.h", + "$outdir/installer_util_strings.rc", + ] + + args = [ + "-i", rebase_path(grdfile, root_build_dir) + ":resources", + "-n", "installer_util_strings", + "-o", rebase_path(outdir, root_build_dir), + ] +} diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn index 83f897d..1a027fc 100644 --- a/chrome/renderer/BUILD.gn +++ b/chrome/renderer/BUILD.gn @@ -36,6 +36,7 @@ static_library("renderer") { "//chrome:resources", "//chrome:strings", "//components/autofill/content/renderer", + "//components/cdm/renderer", "//components/data_reduction_proxy/common", "//components/plugins/renderer", "//components/startup_metric_utils", @@ -45,6 +46,9 @@ static_library("renderer") { "//content/app/strings", "//content/public/renderer", "//extensions:extensions_resources", + "//extensions/renderer", + "//media/cast:net", + "//media/cast:sender", "//media/cast/logging/proto", "//net", "//skia", @@ -59,10 +63,6 @@ static_library("renderer") { "//webkit/child", "//webkit/common", "//webkit/glue/resources", - #"../components/components.gyp:cdm_renderer", TODO(GYP) - #"../extensions/extensions.gyp:extensions_renderer", TODO(GYP) - #"../media/cast/cast.gyp:cast_sender", TODO(GYP) - #"../media/cast/cast.gyp:cast_transport", TODO(GYP) ] if (enable_nacl) { diff --git a/chrome/version.gni b/chrome/version.gni new file mode 100644 index 0000000..771ea28 --- /dev/null +++ b/chrome/version.gni @@ -0,0 +1,60 @@ +# 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. + +# Runs the version processing script over the given template file to produce +# an output file. This is used for generating various forms of files that +# incorporate the product name and version. +# +# This template automatically includes VERSION, LASTCHANGE, and BRANDING, +# +# Parameters: +# source: +# File name of source template file to read. +# +# output: +# File name of file to write. +# +# visibility (optional) +# +# Example: +# process_version("myversion") { +# source = "myfile.h.in" +# output = "$target_gen_dir/myfile.h" +# } +template("process_version") { + assert(defined(invoker.source), "Source must be defined for $target_name") + assert(defined(invoker.output), "Output must be defined for $target_name") + + action(target_name) { + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } + script = "//build/util/version.py" + + lastchange_path = "//build/util/LASTCHANGE" + version_path = "//chrome/VERSION" + if (is_chrome_branded) { + branding_path = "//chrome/app/theme/google_chrome/BRANDING" + } else { + branding_path = "//chrome/app/theme/chromium/BRANDING" + } + + inputs = [ + version_path, + invoker.source, + lastchange_path, + branding_path, + ] + + outputs = [ invoker.output ] + + args = [ + "-f", rebase_path(version_path, root_build_dir), + "-f", rebase_path(branding_path, root_build_dir), + "-f", rebase_path(lastchange_path, root_build_dir), + rebase_path(invoker.source, root_build_dir), + rebase_path(invoker.output, root_build_dir), + ] + } +} |