diff options
author | Mike Klein <mtklein@chromium.org> | 2016-10-17 11:51:11 -0400 |
---|---|---|
committer | Mike Klein <mtklein@chromium.org> | 2016-10-17 16:16:16 +0000 |
commit | 1a8d675148ad92a2f67c075d4f5ca856f416df2a (patch) | |
tree | e96f348e25255ef021a69e201765bb05adae5f97 /gn | |
parent | c7a46650bc746311cbb10bd3f5426f5d0cb6c801 (diff) |
GN: get Angle compiling on Windows.
Angle does not yet link, but it does compile.
I chickened out and wrote cp.py to be the copy tool on Windows. I've got all platforms using it for consistency.
CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-ANGLE-Trybot
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3533
Change-Id: I15f4b63a47121528b2fd2672c26c62765966147c
Reviewed-on: https://skia-review.googlesource.com/3533
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn')
-rw-r--r-- | gn/BUILD.gn | 39 | ||||
-rw-r--r-- | gn/cp.py | 23 |
2 files changed, 61 insertions, 1 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn index df45ada0f5..c972735915 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -399,6 +399,36 @@ toolchain("msvc") { description = "link {{output}}" } + tool("solink") { + dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" + libname = "${dllname}.lib" + pdbname = "${dllname}.pdb" + rspfile = "${dllname}.rsp" + + command = "$env_setup$bin/link.exe /nologo /IMPLIB:$libname /DLL /OUT:$dllname /PDB:$pdbname @$rspfile" + outputs = [ + dllname, + libname, + pdbname, + ] + default_output_extension = ".dll" + default_output_dir = "{{root_out_dir}}" + + link_output = libname + depend_output = libname + runtime_outputs = [ + dllname, + pdbname, + ] + + # I don't quite understand this. Aping Chrome's toolchain/win/BUILD.gn. + restat = true + + # inputs_newline works around a fixed per-line buffer size in the linker. + rspfile_content = "{{inputs_newline}} {{libs}} {{solibs}} {{ldflags}}" + description = "link {{output}}" + } + tool("link") { exename = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" pdbname = "$exename.pdb" @@ -422,6 +452,12 @@ toolchain("msvc") { command = "cmd.exe /c echo > {{output}}" description = "stamp {{output}}" } + + tool("copy") { + cp_py = rebase_path("cp.py") + command = "python.exe $cp_py {{source}} {{output}}" + description = "copy {{source}} {{output}}" + } } toolchain("gcc_like") { @@ -499,7 +535,8 @@ toolchain("gcc_like") { } tool("copy") { - command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})" + cp_py = rebase_path("cp.py") + command = "python $cp_py {{source}} {{output}}" description = "copy {{source}} {{output}}" } } diff --git a/gn/cp.py b/gn/cp.py new file mode 100644 index 0000000000..eedfcb2c7e --- /dev/null +++ b/gn/cp.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# +# Copyright 2016 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import shutil +import sys + +src, dst = sys.argv[1:] + +if os.path.exists(dst): + if os.path.isdir(dst): + shutil.rmtree(dst) + else: + os.remove(dst) + +if os.path.isdir(src): + shutil.copytree(src, dst) +else: + shutil.copy2(src, dst) |