Skip to content

Commit

Permalink
Misc GN build improvements, mostly Windows.
Browse files Browse the repository at this point in the history
Added lots of bug references to TODOs.

Added rules for some remoting test files.

Added manifests for chrome.dll, chrome_child.dll, and chrome_elf.dll

TBR=bradnelson for chrome/test/data/nacl

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

Cr-Commit-Position: refs/heads/master@{#340009}
  • Loading branch information
brettw authored and Commit bot committed Jul 23, 2015
1 parent 72f7079 commit 624c82d
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 71 deletions.
42 changes: 29 additions & 13 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import("//build/config/chrome_build.gni")
import("//build/config/features.gni")
import("//build/config/locales.gni")
import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
import("//chrome/chrome_repack_locales.gni")
import("//chrome/version.gni")

Expand All @@ -14,8 +15,9 @@ if (is_android) {
}

if (!is_android) {
# 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.
# TODO(GYP) bug 512599: 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") {
# Because the sources list varies so significantly per-platform, generally
# each platform lists its own files rather than relying on filtering or
Expand All @@ -29,8 +31,6 @@ if (!is_android) {

# TODO(GYP) mac_bundle_resources, xcode_settings

# TODO(GYP) order_profiling, order_text_section

if (is_win) {
sources += [
"//content/public/common/content_switches.cc",
Expand Down Expand Up @@ -65,9 +65,9 @@ if (!is_android) {
":image_pre_reader",
":main_dll",

# 'chrome_nacl_win64" TODO(GYP)
# '../win8/delegate_execute/delegate_execute.gyp:*', TODO(GYP)
# '../win8/metro_driver/metro_driver.gyp:metro_driver', TODO(GYP)
# 'chrome_nacl_win64" TODO(GYP) bug 512869
# '../win8/delegate_execute/delegate_execute.gyp:*', TODO(GYP) bug 512867
# '../win8/metro_driver/metro_driver.gyp:metro_driver', TODO(GYP) bug 512864
"//base",
"//breakpad:breakpad_handler",
"//breakpad:breakpad_sender",
Expand Down Expand Up @@ -187,6 +187,7 @@ shared_library("main_dll") {
]

deps += [
":chrome_dll_manifest",
":chrome_dll_version",
"//base/trace_event/etw_manifest:chrome_events_win",
"//chrome/app/theme:chrome_unscaled_resources",
Expand All @@ -201,18 +202,15 @@ shared_library("main_dll") {
deps += [ "//components/policy" ]
}
if (current_cpu == "x86") {
# Add a dependency to custom import library for user32 delay imports only
# in x86 builds.
# TODO(GYP) bug 512861: Lots of VCLinkerTool stuff on Windows.
#deps += [ 'chrome_user32_delay_imports' ] TODO(GYP)
}

# This is a large module that can't do incremental linking in some cases.
configs -= [ "//build/config/win:default_incremental_linking" ]
configs += [ "//build/config/win:default_large_module_incremental_linking" ]

# TODO(GYP) Lots of VCLinkerTool stuff on Windows.

# TODO(GYP) chrome_pgo_phase on Windows.
# TODO(GYP) bug 512851: PGO.
}

if (use_aura) {
Expand Down Expand Up @@ -246,6 +244,14 @@ shared_library("main_dll") {
}

if (is_multi_dll_chrome) {
# This manifest matches what GYP produces. It may not even be necessary.
windows_manifest("chrome_child_manifest") {
sources = [
as_invoker_manifest,
]
type = "dll"
}

shared_library("chrome_child") {
sources = [
"app/chrome_main.cc",
Expand All @@ -260,13 +266,14 @@ if (is_multi_dll_chrome) {

deps = [
":child_dependencies",
":chrome_child_manifest",
":chrome_dll_version",
"//chrome/browser/policy:path_parser",
"//content/public/app:child",
]

if (is_win) {
# TODO(GYP): PGO on Windows.
# TODO(GYP) bug 512851: PGO on Windows.
# ['chrome_pgo_phase==1', {
# 'msvs_settings': {
# 'VCLinkerTool': {
Expand Down Expand Up @@ -367,6 +374,15 @@ if (is_win) {
output = "$target_gen_dir/chrome_dll_version.rc"
}

# This manifest matches what GYP produces. It may not even be necessary.
windows_manifest("chrome_dll_manifest") {
sources = [
as_invoker_manifest,
common_controls_manifest,
]
type = "dll"
}

process_version("nacl64_exe_version") {
sources = [
"app/nacl64_exe.ver",
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ source_set("browser") {
sources +=
rebase_path(gypi_values.chrome_browser_mac_sources, ".", "//chrome")
deps += [
#"app_shim" TODO(GYP)
#"browser_app_shim" TODO(GYP)
#"app_shim" TODO(GYP) bug 512600
#"browser_app_shim" TODO(GYP) bug 512600
]
}
if (enable_extensions) {
Expand Down
41 changes: 17 additions & 24 deletions chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,8 @@ if (!is_android) {
# Runtime dependencies
data_deps = [
"//ppapi:ppapi_tests",

#'../remoting/remoting.gyp:remoting_browser_test_resources', TODO(GYP)
#'../remoting/remoting.gyp:remoting_webapp_unittests', TODO(GYP)
"//remoting/webapp:browser_test_resources",
"//remoting/webapp:unit_tests",
"//third_party/mesa:osmesa",
"//third_party/widevine/cdm:widevine_test_license_server",
]
Expand Down Expand Up @@ -662,18 +661,18 @@ if (!is_android) {
# to know all of the different toolchain options.
assert(current_cpu == "x64")
data_deps += [
# "test/data/nacl:shared_test_files", # TODO(GYP)
# "test/data/nacl:shared_test_files", # TODO(GYP) bug 512902
"//ppapi/native_client:nacl_irt(//native_client/build/toolchain/nacl:irt_x64)",
# "../ppapi/ppapi_nacl.gyp:ppapi_nacl_tests", # TODO(GYP)
# "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_background_keepalive", # TODO(GYP)
# "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_media_galleries", # TODO(GYP)
# "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_packaged_app", # TODO(GYP)
# "../ppapi/ppapi_nacl.gyp:ppapi_nacl_tests", # TODO(GYP) bug 512901
# "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_background_keepalive", # TODO(GYP) bug 512900
# "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_media_galleries", # TODO(GYP) bug 512900
# "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_packaged_app", # TODO(GYP) bug 512900
]
if (is_chromeos) {
sources += [ "//third_party/liblouis/nacl_wrapper/liblouis_wrapper_browsertest.cc" ]
deps += [
#'browser_chromeos', TODO(GYP)
#'../third_party/liblouis/liblouis_nacl.gyp:liblouis_test_data', TODO(GYP)
"//chrome/browser/chromeos",
#'../third_party/liblouis/liblouis_nacl.gyp:liblouis_test_data', TODO(GYP) bug 512906
]
}
}
Expand All @@ -686,7 +685,7 @@ if (!is_android) {
# browser process as needed by this test. See http://crbug.com/157312.
sources -= [ "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc" ]
deps += [
#'chrome.gyp:chrome_nacl_win64', TODO(GYP)
#'chrome.gyp:chrome_nacl_win64', TODO(GYP) bug 512869
]
configs -= [ "//build/config/win:default_incremental_linking" ]
configs +=
Expand All @@ -697,7 +696,7 @@ if (!is_android) {
"//native_client/src/trusted/service_runtime/linux:munge_nacl_helper_bootstrap",
"//components/nacl:nacl_helper",

# "//components/nacl_nonsfi.gyp:nacl_helper_nonsfi", # TODO(GYP)
# "//components/nacl_nonsfi.gyp:nacl_helper_nonsfi", # TODO(GYP) bug 512912.
]
}
}
Expand Down Expand Up @@ -747,7 +746,7 @@ if (!is_android) {
"//dbus",
"//dbus:test_support",

#"//ui/login:resources", TODO(GYP)
#"//ui/login:resources", TODO(GYP) bug 512913
]
} else {
sources -= [
Expand Down Expand Up @@ -1573,19 +1572,17 @@ if (!is_android) {
]
}
if (is_win) {
if (!is_component_build) {
# Unit_tests pdb files can get too big when incremental linking is
# on, disabling for this target.
#'LinkIncremental': '<(msvs_debug_link_nonincremental)', TODO(GYP)
}
# The PDB gets too large for incremental linking.
configs -= [ "//build/config/win:default_incremental_linking" ]
configs += [ "//build/config/win:no_incremental_linking" ]

sources += rebase_path(
chrome_tests_unit_gypi_values.chrome_unit_tests_win_sources,
".",
"//chrome")
deps += [
#'browser/safe_browsing/incident_reporting/verifier_test/verifier_unittest.gyp:verifier_test_dll_1', TODO(GYP)
#'browser/safe_browsing/incident_reporting/verifier_test/verifier_unittest.gyp:verifier_test_dll_2', TODO(GYP)
#'browser/safe_browsing/incident_reporting/verifier_test/verifier_unittest.gyp:verifier_test_dll_1', TODO(GYP) bug 512919
#'browser/safe_browsing/incident_reporting/verifier_test/verifier_unittest.gyp:verifier_test_dll_2', TODO(GYP) bug 512919
"//chrome:other_version",
"//chrome_elf:blacklist_test_dll_1",
"//chrome/installer/util:strings",
Expand All @@ -1595,10 +1592,6 @@ if (!is_android) {
"//ui/resources",
]

configs -= [ "//build/config/win:default_incremental_linking" ]
configs +=
[ "//build/config/win:default_large_module_incremental_linking" ]

libs = [
"comsupp.lib",
"oleacc.lib",
Expand Down
1 change: 1 addition & 0 deletions chrome/test/data/nacl/nacl_test_data.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
],
'targets': [
{
# TODO bug 512902 this needs to be ported to GN.
'target_name': 'shared_test_files',
'type': 'none',
'variables': {
Expand Down
10 changes: 10 additions & 0 deletions chrome_elf/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/win/manifest.gni")
import("//chrome/version.gni")
import("//testing/test.gni")

Expand All @@ -12,6 +13,14 @@ process_version("chrome_elf_resources") {
output = "$target_gen_dir/chrome_elf_version.rc"
}

# This manifest matches what GYP produces. It may not even be necessary.
windows_manifest("chrome_elf_manifest") {
sources = [
as_invoker_manifest,
]
type = "dll"
}

shared_library("chrome_elf") {
sources = [
"chrome_elf_main.cc",
Expand All @@ -20,6 +29,7 @@ shared_library("chrome_elf") {
deps = [
":blacklist",
":breakpad",
":chrome_elf_manifest",
":lib",
":chrome_elf_resources",
]
Expand Down
6 changes: 6 additions & 0 deletions remoting/remoting_test.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@
], # end of 'conditions'
}, # end of target 'remoting_unittests'
{
# GN version: //remoting/webapp:browser_test_resources
'target_name': 'remoting_browser_test_resources',
'type': 'none',
'copies': [
Expand Down Expand Up @@ -441,6 +442,7 @@
], # end of actions
}, # end of target 'remoting_webapp_browser_test_html'
{
# GN version: //remoting/webapp:unit_tests
'target_name': 'remoting_webapp_unittests',
'type': 'none',
'variables': {
Expand All @@ -453,6 +455,7 @@
},
'copies': [
{
# GN version: //remoting/webapp:qunit
'destination': '<(output_dir)/qunit',
'files': [
'../third_party/qunit/src/browser_test_harness.js',
Expand All @@ -461,20 +464,23 @@
],
},
{
# GN version: //remoting/webapp:blanketjs
'destination': '<(output_dir)/blanketjs',
'files': [
'../third_party/blanketjs/src/blanket.js',
'../third_party/blanketjs/src/qunit_adapter.js',
],
},
{
# GN version: //remoting/webapp:sinonjs
'destination': '<(output_dir)/sinonjs',
'files': [
'../third_party/sinonjs/src/sinon.js',
'../third_party/sinonjs/src/sinon-qunit.js',
],
},
{
# GN version: //remoting/webapp:js_files
'destination': '<(output_dir)',
'files': [
'<@(webapp_js_files)',
Expand Down
63 changes: 63 additions & 0 deletions remoting/webapp/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import("//build/config/features.gni")
import("//remoting/webapp/build_template.gni")
import("//remoting/webapp/files.gni")

group("webapp") {
deps = [
Expand Down Expand Up @@ -82,3 +83,65 @@ app_remoting_shared_module("ar_shared_module") {
#app_client_id = "sample_client_id"
app_name = "shared_module"
}

# GYP version: remoting/remoting_tests.gypi:remoting_browser_test_resources
copy("browser_test_resources") {
sources = remoting_webapp_browsertest_main_html_extra_files
outputs = [
"$root_out_dir/remoting/browser_test_resources/{{source_file_part}}",
]
}

remoting_unit_test_out_dir = "$root_out_dir/remoting/unittests"

group("unit_tests") {
data_deps = [
":blanketjs",
":js_files",
":qunit",
":sinonjs",
]
}

copy("js_files") {
# This list corresponds to webapp_js_files in remoting_webapp_unittests
# target in GYP.
sources = remoting_webapp_unittest_html_all_js_files +
remoting_webapp_wcs_sandbox_html_js_files +
remoting_webapp_background_html_js_files +
remoting_webapp_unittests_all_files
outputs = [
"$remoting_unit_test_out_dir/{{source_file_part}}",
]
}

copy("blanketjs") {
sources = [
"//third_party/blanketjs/src/blanket.js",
"//third_party/blanketjs/src/qunit_adapter.js",
]
outputs = [
"$remoting_unit_test_out_dir/blanketjs/{{source_file_part}}",
]
}

copy("sinonjs") {
sources = [
"//third_party/sinonjs/src/sinon-qunit.js",
"//third_party/sinonjs/src/sinon.js",
]
outputs = [
"$remoting_unit_test_out_dir/sinonjs/{{source_file_part}}",
]
}

copy("qunit") {
sources = [
"//third_party/qunit/src/browser_test_harness.js",
"//third_party/qunit/src/qunit.css",
"//third_party/qunit/src/qunit.js",
]
outputs = [
"$remoting_unit_test_out_dir/qunit/{{source_file_part}}",
]
}
Loading

0 comments on commit 624c82d

Please sign in to comment.