diff options
Diffstat (limited to 'gn/BUILD.gn')
-rw-r--r-- | gn/BUILD.gn | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn index bd5ce7fe2c..8451b9f078 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -12,6 +12,11 @@ declare_args() { ar = "$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin/ar" cc = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang" cxx = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang++" + if (host_os == "win") { + ar = ar + ".exe" + cc = cc + ".exe" + cxx = cxx + ".exe" + } } windk = "C:/Program Files (x86)/Microsoft Visual Studio 14.0" @@ -24,6 +29,14 @@ declare_args() { cc_wrapper = "" } +if (host_os == "win") { + python = "python.bat" + stamp = "cmd.exe /c echo >" +} else { + python = "python" + stamp = "touch" +} + if (!is_win) { is_clang = exec_script("is_clang.py", [ @@ -465,13 +478,13 @@ toolchain("msvc") { } tool("stamp") { - command = "cmd.exe /c echo > {{output}}" + command = "$stamp {{output}}" description = "stamp {{output}}" } tool("copy") { cp_py = rebase_path("cp.py") - command = "python.bat $cp_py {{source}} {{output}}" + command = "$python $cp_py {{source}} {{output}}" description = "copy {{source}} {{output}}" } } @@ -531,7 +544,15 @@ toolchain("gcc_like") { } tool("alink") { - command = "rm -f {{output}} && $ar rcs {{output}} {{inputs}}" + if (host_os == "win") { + rspfile = "{{output}}.rsp" + rspfile_content = "{{inputs}}" + ar_py = rebase_path("ar.py") + command = "$python $ar_py $ar {{output}} $rspfile" + } else { + # We'd use ar.py all the time, but Mac ar doesn't support @rspfile syntax. :( + command = "rm -f {{output}} && $ar rcs {{output}} {{inputs}}" + } outputs = [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", ] @@ -566,13 +587,13 @@ toolchain("gcc_like") { } tool("stamp") { - command = "touch {{output}}" + command = "$stamp {{output}}" description = "stamp {{output}}" } tool("copy") { cp_py = rebase_path("cp.py") - command = "python $cp_py {{source}} {{output}}" + command = "$python $cp_py {{source}} {{output}}" description = "copy {{source}} {{output}}" } } |