Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use clang-cl for Windows builds #23256

Merged
merged 3 commits into from Apr 25, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

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

  • Loading branch information
jdm committed Apr 25, 2019
commit c038ba4c7c98a21ccbf7f415a7bbc14231d6920a
@@ -22,5 +22,5 @@ ar = "arm-linux-gnueabihf-ar"
linker = "aarch64-linux-gnu-gcc"
ar = "aarch64-linux-gnu-ar"

[target.'cfg(target_os=windows)']
linker = "./support/android/fakeld/fake-ld.cmd"
[target.x86_64-pc-windows-msvc]
linker = "lld-link.exe"
@@ -30,6 +30,9 @@ environment:
C:\\Program Files\\Git\\cmd;\
C:\\Program Files\\Git\\usr\\bin;\
C:\\Program Files\\AppVeyor\\BuildAgent;"
CC: "clang-cl.exe"
CXX: "clang-cl.exe"

matrix:
- TARGET: nightly-x86_64-pc-windows-msvc

@@ -25,11 +25,6 @@ fn main() {
// We must use Ninja on Windows for this -- msbuild is painfully slow,
// and ninja is easier to install than make.
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,
// for reasons that I don't understand. If we just give
// link.exe, it tries to use script-*/out/link.exe, which of
@@ -310,6 +310,10 @@ def build(self, target=None, release=False, dev=False, jobs=None,
if with_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_NDK" not in env:
print("Please set the ANDROID_NDK environment variable.")
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.