From f447c6b1ec485964686c3d8bd92fa78873398a18 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 17 Jun 2019 08:19:49 -0400 Subject: [PATCH 1/2] Force clang use on all platforms. --- python/servo/build_commands.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 26f5da3ca25..6af8b1bd3a0 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -317,8 +317,11 @@ class MachCommands(CommandBase): env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C debug_assertions" if sys.platform == "win32": - env["CC"] = "clang-cl.exe" - env["CXX"] = "clang-cl.exe" + env["CC"] = env.get("CC", "clang-cl.exe") + env["CXX"] = env.get("CXX", "clang-cl.exe") + else: + env["CC"] = env.get("CC", "clang") + env["CXX"] = env.get("CXX", "clang++") host = host_triple() if 'apple-darwin' in host and (not target or target == host): From 6167005997186e2b05a4e79cac69cf27fadf7b3f Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 17 Jun 2019 13:10:03 -0400 Subject: [PATCH 2/2] Set CC/CXX defaults right before starting cargo build. --- python/servo/build_commands.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 6af8b1bd3a0..582da195356 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -316,13 +316,6 @@ class MachCommands(CommandBase): if with_debug_assertions: env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C debug_assertions" - if sys.platform == "win32": - env["CC"] = env.get("CC", "clang-cl.exe") - env["CXX"] = env.get("CXX", "clang-cl.exe") - else: - env["CC"] = env.get("CC", "clang") - env["CXX"] = env.get("CXX", "clang++") - host = host_triple() if 'apple-darwin' in host and (not target or target == host): if 'CXXFLAGS' not in env: @@ -612,6 +605,13 @@ class MachCommands(CommandBase): for key in env: print((key, env[key])) + if sys.platform == "win32": + env.setdefault("CC", "clang-cl.exe") + env.setdefault("CXX", "clang-cl.exe") + else: + env.setdefault("CC", "clang") + env.setdefault("CXX", "clang++") + status = self.call_rustup_run(["cargo", "build"] + opts, env=env, verbose=verbose) elapsed = time() - build_start