From 16b66db9c74bb16145bf9fd96d4417895722b1e3 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Thu, 19 Jul 2018 16:57:54 -0700 Subject: [PATCH] build: [gn] working on 32bit windows --- atom/common/crash_reporter/crash_reporter_win.h | 2 ++ build/node/BUILD.gn | 1 + docs/development/build-instructions-gn.md | 15 +++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/atom/common/crash_reporter/crash_reporter_win.h b/atom/common/crash_reporter/crash_reporter_win.h index a6fe33fcd5cd..89a2a5966d6c 100644 --- a/atom/common/crash_reporter/crash_reporter_win.h +++ b/atom/common/crash_reporter/crash_reporter_win.h @@ -65,7 +65,9 @@ class CrashReporterWin : public CrashReporter { google_breakpad::CustomClientInfo custom_info_; bool skip_system_crash_handler_ = false; +#ifdef _WIN64 bool code_range_registered_ = false; +#endif std::unique_ptr breakpad_; DISALLOW_COPY_AND_ASSIGN(CrashReporterWin); diff --git a/build/node/BUILD.gn b/build/node/BUILD.gn index 6af725fa0b08..25c70fbab4d6 100644 --- a/build/node/BUILD.gn +++ b/build/node/BUILD.gn @@ -27,6 +27,7 @@ action("configure_node") { "--prefix=", "--config-out-dir=" + rebase_path(target_gen_dir), "--no-run-gyp", + "--dest-cpu=$target_cpu", ] if (is_component_build) { args += [ "--shared" ] diff --git a/docs/development/build-instructions-gn.md b/docs/development/build-instructions-gn.md index cdddc4dc8e54..70c5d7a816b7 100644 --- a/docs/development/build-instructions-gn.md +++ b/docs/development/build-instructions-gn.md @@ -69,6 +69,21 @@ $ ./out/Default/Electron.app/Contents/MacOS/Electron $ ./out/Default/electron ``` +### Cross-compiling + +To compile for a platform that isn't the same as the one you're building on, +set the `target_cpu` GN argument. For example, to compile a windows x86 target +from an x64 host, specify `target_cpu = "x86"` in `gn args`. + +```sh +$ gn gen out/Default-x86 --args='... target_cpu = "x86"' +``` + +Not all combinations of source and target CPU/OS are supported by Chromium. +Only cross-compiling Windows 32-bit from Windows 64-bit has been tested in +Electron. If you test other combinations and find them to work, please update +this document :) + ## Tests To run the tests, you'll first need to build the test modules against the