aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-07-31 11:57:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-31 18:39:23 +0000
commitc722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8 (patch)
treef85d2595f5545e2f01d89cc1cf2a0d412cb0d5ea /gn
parentd301629d1dad5da36d6f8225f17b92a3f36eaf2a (diff)
clang on windows support
1) Run python bin/fetch-clang-win 2) Set clang_win = "../bin/clang_win" 3) ??? 4) Profit Most changes here are to pass the right -mfoo flags to Clang to enable advanced instruction sets, or fixed warning-as-errors. BUG=skia:2679 Change-Id: Ieed145d35c209131c7c16fdd3ee11a3de4a1a921 Reviewed-on: https://skia-review.googlesource.com/28740 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn')
-rw-r--r--gn/BUILD.gn10
-rw-r--r--gn/BUILDCONFIG.gn11
-rw-r--r--gn/toolchain/BUILD.gn11
3 files changed, 20 insertions, 12 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 71475a8110..ca9059d2c1 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -13,16 +13,6 @@ declare_args() {
malloc = ""
}
-is_clang = is_android || is_ios || is_mac || (cc == "clang" && cxx == "clang++")
-if (!is_clang && !is_win) {
- is_clang = exec_script("is_clang.py",
- [
- cc,
- cxx,
- ],
- "value")
-}
-
if (is_ios) {
if (is_tvos) {
sdk = "appletvos"
diff --git a/gn/BUILDCONFIG.gn b/gn/BUILDCONFIG.gn
index 43f66f8832..ca91c1bcb3 100644
--- a/gn/BUILDCONFIG.gn
+++ b/gn/BUILDCONFIG.gn
@@ -23,6 +23,7 @@ declare_args() {
cxx = "c++"
msvc = 2015
+ clang_win = ""
}
declare_args() {
is_debug = !is_official_build
@@ -68,6 +69,16 @@ if (current_cpu == "") {
current_cpu = target_cpu
}
+is_clang = is_android || is_ios || is_mac || (cc == "clang" && cxx == "clang++") || clang_win != ""
+if (!is_clang && !is_win) {
+ is_clang = exec_script("gn/is_clang.py",
+ [
+ cc,
+ cxx,
+ ],
+ "value")
+}
+
if (is_android) {
ndk_host = ""
ndk_target = ""
diff --git a/gn/toolchain/BUILD.gn b/gn/toolchain/BUILD.gn
index c5b13107c5..14a8a91965 100644
--- a/gn/toolchain/BUILD.gn
+++ b/gn/toolchain/BUILD.gn
@@ -50,6 +50,13 @@ toolchain("msvc") {
}
}
+ if (clang_win != "") {
+ cl = "$clang_win/bin/clang-cl.exe"
+ } else {
+ cl = "$bin/cl.exe"
+ }
+
+
tool("asm") {
_ml = "ml"
if (target_cpu == "x64") {
@@ -68,7 +75,7 @@ toolchain("msvc") {
pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb"
# Label names may have spaces so pdbname must be quoted.
- command = "$env_setup$bin/cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
+ command = "$env_setup$cl /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
depsformat = "msvc"
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
@@ -83,7 +90,7 @@ toolchain("msvc") {
pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb"
# Label names may have spaces so pdbname must be quoted.
- command = "$env_setup$bin/cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
+ command = "$env_setup$cl /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
depsformat = "msvc"
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",