From 14dbd3531d9897234991bd80c3d3af53856b295e Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Tue, 6 Feb 2018 10:57:23 -0800 Subject: [PATCH] gn win: Get main test binaries building - default to subsystem:console - don't build posix/timezone.* - add some missing libs This gets all the main binaries building and running. Most configs pass, but there's some offsets that seem different in some builds; need to investigate more. Additionally, the binaries used by end_to_end_test.py aren't yet built, so that script fails. Includes mini_chromium roll to 46eeaf9: 46eea49 gn win: Add debug info and pdb to cc/cxx 902a29f gn win: Various fixes towards making GN build work Bug: crashpad:79 Change-Id: Ie56a469b84bed7b0330172cec9f1a8aeb95f702e Reviewed-on: https://chromium-review.googlesource.com/902403 Commit-Queue: Scott Graham Reviewed-by: Mark Mentovai --- DEPS | 2 +- build/BUILDCONFIG.gn | 6 ++++-- handler/BUILD.gn | 11 +++++++++-- snapshot/BUILD.gn | 9 +++++++-- test/BUILD.gn | 9 ++++++++- util/BUILD.gn | 13 ++++++++----- 6 files changed, 37 insertions(+), 13 deletions(-) diff --git a/DEPS b/DEPS index 6936f9f2..e60b57a9 100644 --- a/DEPS +++ b/DEPS @@ -28,7 +28,7 @@ deps = { '5e2b3ddde7cda5eb6bc09a5546a76b00e49d888f', 'crashpad/third_party/mini_chromium/mini_chromium': Var('chromium_git') + '/chromium/mini_chromium@' + - '3b953302848580cdf23b50402befc0ae09d03ff9', + '46eea49ed02ecad04a296794ab25fbdd85202558', 'crashpad/third_party/zlib/zlib': Var('chromium_git') + '/chromium/src/third_party/zlib@' + '13dc246a58e4b72104d35f9b1809af95221ebda7', diff --git a/build/BUILDCONFIG.gn b/build/BUILDCONFIG.gn index 67d56ae4..82bcf73b 100644 --- a/build/BUILDCONFIG.gn +++ b/build/BUILDCONFIG.gn @@ -54,8 +54,10 @@ _default_configs = [ ] _default_executable_configs = - _default_configs + - [ "//third_party/mini_chromium/mini_chromium/build:executable" ] + _default_configs + [ + "//third_party/mini_chromium/mini_chromium/build:executable", + "//third_party/mini_chromium/mini_chromium/build:win_console", + ] set_defaults("source_set") { configs = _default_configs diff --git a/handler/BUILD.gn b/handler/BUILD.gn index 9c337697..ffc9d9b0 100644 --- a/handler/BUILD.gn +++ b/handler/BUILD.gn @@ -147,8 +147,15 @@ executable("crashpad_handler") { } if (crashpad_is_win) { - configs -= [ "//build/config/win:console" ] - configs += [ "//build/config/win:windowed" ] + if (crashpad_is_in_chromium) { + configs -= [ "//build/config/win:console" ] + configs += [ "//build/config/win:windowed" ] + } else { + configs -= + [ "//third_party/mini_chromium/mini_chromium/build:win_console" ] + configs += + [ "//third_party/mini_chromium/mini_chromium/build:win_windowed" ] + } } } diff --git a/snapshot/BUILD.gn b/snapshot/BUILD.gn index e1d24002..785f7970 100644 --- a/snapshot/BUILD.gn +++ b/snapshot/BUILD.gn @@ -47,8 +47,6 @@ static_library("snapshot") { "minidump/process_snapshot_minidump.cc", "minidump/process_snapshot_minidump.h", "module_snapshot.h", - "posix/timezone.cc", - "posix/timezone.h", "process_snapshot.h", "snapshot_constants.h", "system_snapshot.h", @@ -57,6 +55,13 @@ static_library("snapshot") { "unloaded_module_snapshot.h", ] + if (crashpad_is_posix) { + sources += [ + "posix/timezone.cc", + "posix/timezone.h", + ] + } + if (crashpad_is_mac) { sources += [ "mac/cpu_context_mac.cc", diff --git a/test/BUILD.gn b/test/BUILD.gn index f7541749..0ddde6e1 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -96,7 +96,6 @@ static_library("test") { if (crashpad_is_fuchsia) { sources += [ "multiprocess_exec_fuchsia.cc" ] - libs = [ "launchpad" ] } public_configs = [ "..:crashpad_config" ] @@ -121,6 +120,14 @@ static_library("test") { "../snapshot", ] } + + if (crashpad_is_win) { + libs = [ "shell32.lib" ] + } + + if (crashpad_is_fuchsia) { + libs = [ "launchpad" ] + } } source_set("test_test") { diff --git a/util/BUILD.gn b/util/BUILD.gn index 13a5da80..2f376110 100644 --- a/util/BUILD.gn +++ b/util/BUILD.gn @@ -407,11 +407,11 @@ static_library("util") { } if (crashpad_is_win) { - cflags = [ - "/wd4201", # nonstandard extension used : nameless struct/union. - "/wd4577", # 'noexcept' used with no exception handling mode specified. + libs = [ + "mincore.lib", + "user32.lib", + "winhttp.lib", ] - libs = [ "winhttp.lib" ] if (current_cpu == "x86") { asmflags = [ "/safeseh" ] @@ -568,7 +568,10 @@ source_set("util_test") { } if (crashpad_is_win) { - libs = [ "rpcrt4.lib" ] + libs = [ + "rpcrt4.lib", + "dbghelp.lib", + ] data_deps = [ ":crashpad_util_test_process_info_test_child", ":crashpad_util_test_safe_terminate_process_test_child",