Add Win Clang x86 builds.
Enable /arch:SSE2 for Win x86 builds (both MSVC and Clang).
Change-Id: I0618e938b6542b60fae3947b7e0dcde22650ba54
Reviewed-on: https://skia-review.googlesource.com/56721
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/gn/toolchain/BUILD.gn b/gn/toolchain/BUILD.gn
index 4cfd886..fd2aafa 100644
--- a/gn/toolchain/BUILD.gn
+++ b/gn/toolchain/BUILD.gn
@@ -46,7 +46,14 @@
env_setup = "cmd /c $win_sdk/bin/SetEnv.cmd /x86 && "
}
+ cl_m32_flag = ""
if (clang_win != "") {
+ if (target_cpu == "x86") {
+ # cl.exe knows implicitly by the choice of executable that it's targeting
+ # x86, but clang-cl.exe needs to be told when targeting non-host
+ # platforms. (All our builders are x86-64, so x86 is always non-host.)
+ cl_m32_flag = "-m32"
+ }
cl = "$clang_win/bin/clang-cl.exe"
} else {
cl = "$bin/cl.exe"
@@ -75,7 +82,8 @@
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
]
- rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}"
+ rspfile_content =
+ "{{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_c}}"
description = "compile {{source}}"
}
@@ -90,7 +98,8 @@
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
]
- rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}"
+ rspfile_content =
+ "{{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_cc}}"
description = "compile {{source}}"
}