From 05a8c33afaf3bedee93818f0a6c3bc0494113700 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Fri, 22 Nov 2013 22:13:47 +0000 Subject: Add "ninja show" and "ninja refresh" targets to GN build. "ninja show" will print out the build arguments for when you can't remember the configuration of your output directory. "ninja refresh" ignores dependencies and regenerates the ninja files. R=scottmg@chromium.org Review URL: https://codereview.chromium.org/82923005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236840 0039d316-1c4b-4281-b951-d872f2087c98 --- build/config/BUILDCONFIG.gn | 26 +++++++++++++++++++++----- build/config/win/BUILD.gn | 5 +---- 2 files changed, 22 insertions(+), 9 deletions(-) (limited to 'build/config') diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index bd4dac8..d3a0683 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -43,6 +43,15 @@ declare_args() { # TODO(brettw) this should be moved out of the main build config file. use_ozone = false + # Forces a 64-bit build on Windows. Does nothing on other platforms. Normally + # we build 32-bit on Windows regardless of the current host OS bit depth. + # Setting this flag will override this logic and generate 64-bit toolchains. + # + # Normally this would get set automatically when you specify a target using + # the 64-bit toolchain. You can also set this on the command line to convert + # the default toolchain to 64-bit. + force_win64 = false + # Set to true on the command line when invoked by GYP. Build files can key # off of this to make any GYP-output-specific changes to the build. is_gyp = false @@ -138,10 +147,13 @@ if (os == "win") { # ============================================================================= if (is_win) { - # Always use 32-bit on Windows, even when compiling on a 64-bit host OS. - # TODO(brettw) when we support 64-bit cross-compiles, we probably need to - # set a build arg in the toolchain to disable this override. - cpu_arch = "ia32" + # Always use 32-bit on Windows, even when compiling on a 64-bit host OS, + # unless the override flag is specified. + if (force_win64) { + cpu_arch = "ia64" + } else { + cpu_arch = "ia32" + } } # ============================================================================= @@ -371,7 +383,11 @@ set_defaults("source_set") { # default toolchain. if (is_win) { - host_toolchain = "//build/toolchain/win:32" + if (cpu_arch == "ia64") { + host_toolchain = "//build/toolchain/win:64" + } else if (cpu_arch == "ia32") { + host_toolchain = "//build/toolchain/win:32" + } set_default_toolchain(host_toolchain) } else if (is_linux) { host_toolchain = "//build/toolchain/linux:host" diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn index e101c2b..72147e0 100644 --- a/build/config/win/BUILD.gn +++ b/build/config/win/BUILD.gn @@ -44,10 +44,7 @@ config("sdk") { # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. config("sdk_link") { - # TODO(brettw) 64-bit. - is_64bit = false - - if (is_64bit) { + if (cpu_arch == "ia64") { ldflags = [ "/MACHINE:X64" ] lib_dirs = [ "$windows_sdk_path\Lib\win8\um\x64", -- cgit v1.1