Skip to content

Commit

Permalink
Force the use of clang-cl.exe for Windows builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Apr 24, 2019
1 parent 817aa49 commit c1c9799
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions components/script/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions python/servo/build_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ 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"
#env["CMAKE_TOOLCHAIN_FILE"] = path.join(self.get_top_dir(), "support",
# "windows", "windows-clang.toolchain")

if android:
if "ANDROID_NDK" not in env:
print("Please set the ANDROID_NDK environment variable.")
Expand Down
4 changes: 4 additions & 0 deletions support/windows/windows-clang.toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER "clang-cl.exe")
set(CMAKE_CXX_COMPILER "clang-cl.exe")
#set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin/MSBuild.exe")

0 comments on commit c1c9799

Please sign in to comment.