Force the use of clang-cl.exe for Windows builds.

This commit is contained in:
Josh Matthews 2019-04-24 16:19:37 -04:00
parent 817aa49dc7
commit c038ba4c7c
4 changed files with 9 additions and 7 deletions

View file

@ -22,5 +22,5 @@ ar = "arm-linux-gnueabihf-ar"
linker = "aarch64-linux-gnu-gcc" linker = "aarch64-linux-gnu-gcc"
ar = "aarch64-linux-gnu-ar" ar = "aarch64-linux-gnu-ar"
[target.'cfg(target_os=windows)'] [target.x86_64-pc-windows-msvc]
linker = "./support/android/fakeld/fake-ld.cmd" linker = "lld-link.exe"

View file

@ -30,6 +30,9 @@ environment:
C:\\Program Files\\Git\\cmd;\ C:\\Program Files\\Git\\cmd;\
C:\\Program Files\\Git\\usr\\bin;\ C:\\Program Files\\Git\\usr\\bin;\
C:\\Program Files\\AppVeyor\\BuildAgent;" C:\\Program Files\\AppVeyor\\BuildAgent;"
CC: "clang-cl.exe"
CXX: "clang-cl.exe"
matrix: matrix:
- TARGET: nightly-x86_64-pc-windows-msvc - TARGET: nightly-x86_64-pc-windows-msvc

View file

@ -25,11 +25,6 @@ fn main() {
// We must use Ninja on Windows for this -- msbuild is painfully slow, // We must use Ninja on Windows for this -- msbuild is painfully slow,
// and ninja is easier to install than make. // and ninja is easier to install than make.
build.generator("Ninja"); build.generator("Ninja");
// because we're using ninja, we need to explicitly set these
// to VC++, otherwise it'll try to use cc
build
.define("CMAKE_C_COMPILER", "cl.exe")
.define("CMAKE_CXX_COMPILER", "cl.exe");
// We have to explicitly specify the full path to link.exe, // We have to explicitly specify the full path to link.exe,
// for reasons that I don't understand. If we just give // for reasons that I don't understand. If we just give
// link.exe, it tries to use script-*/out/link.exe, which of // link.exe, it tries to use script-*/out/link.exe, which of

View file

@ -310,6 +310,10 @@ class MachCommands(CommandBase):
if with_debug_assertions: if with_debug_assertions:
env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C debug_assertions" env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C debug_assertions"
if sys.platform == "win32":
env["CC"] = "clang-cl.exe"
env["CXX"] = "clang-cl.exe"
if android: if android:
if "ANDROID_NDK" not in env: if "ANDROID_NDK" not in env:
print("Please set the ANDROID_NDK environment variable.") print("Please set the ANDROID_NDK environment variable.")