From df574048f5acc737775fc0281e3022d7faac0781 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Tue, 13 Mar 2018 15:11:14 -0400 Subject: 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 Reviewed-by: Mike Klein --- gn/toolchain/BUILD.gn | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gn/toolchain') diff --git a/gn/toolchain/BUILD.gn b/gn/toolchain/BUILD.gn index 4cfd886fcf..fd2aafa913 100644 --- a/gn/toolchain/BUILD.gn +++ b/gn/toolchain/BUILD.gn @@ -46,7 +46,14 @@ toolchain("msvc") { 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 @@ toolchain("msvc") { 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 @@ toolchain("msvc") { 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}}" } -- cgit v1.2.3