Auto merge of #23256 - jdm:clang-cl, r=asajeffrey

Use clang-cl for Windows builds

Depends on https://github.com/servo/mozjs/pull/178.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23256)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-04-25 14:35:59 -04:00 committed by GitHub
commit 36bb42525a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 11 deletions

View file

@ -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"

6
Cargo.lock generated
View file

@ -2810,13 +2810,13 @@ dependencies = [
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs_sys 0.61.11 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs_sys 0.61.12 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mozjs_sys"
version = "0.61.11"
version = "0.61.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bindgen 0.49.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -5593,7 +5593,7 @@ dependencies = [
"checksum mitochondria 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9de3eca27871df31c33b807f834b94ef7d000956f57aa25c5aed9c5f0aae8f6f"
"checksum mozangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "45a8a18a41cfab0fde25cc2f43ea89064d211a0fbb33225b8ff93ab20406e0e7"
"checksum mozjs 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "622108d35f4fdd68b3aa39bfe9bedaee5fa9efd19711d046e1d56ff607c0a36f"
"checksum mozjs_sys 0.61.11 (registry+https://github.com/rust-lang/crates.io-index)" = "22ab5d3738fc69d394b30e1256d2cbf5b4f1e668a7deba94f9f3726dcfc89689"
"checksum mozjs_sys 0.61.12 (registry+https://github.com/rust-lang/crates.io-index)" = "370887111c83436555cde840bb2639c5a088c77f01b152957d99e1f279397f48"
"checksum msdos_time 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aad9dfe950c057b1bfe9c1f2aa51583a8468ef2a5baba2ebbe06d775efeb7729"
"checksum muldiv 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "451a9a05d2a32c566c897835e0ea95cf79ed2fdfe957924045a1721a36c9980f"
"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"

View file

@ -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

View file

@ -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

View file

@ -310,6 +310,10 @@ class MachCommands(CommandBase):
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.")

View file

@ -3,7 +3,7 @@
# You can obtain one at https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.7.2",
"cmake": "3.14.3",
"llvm": "7.0.0",
"moztools": "3.2",
"ninja": "1.7.1",