From 429ce7900bb1ff34a8a719eced336489e56afd19 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 27 Feb 2018 20:13:16 -0500 Subject: [PATCH] Bug 1439767 - add .mozbuild clang path to the toolchain search path on Windows; r=nalexander Doing this means compiling with clang-cl is just `export CC=clang-cl` in somebody's mozconfig, rather than something more elaborate. --- build/moz.configure/toolchain.configure | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index 7e40bd703eb5..597fa9be2cc4 100755 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -646,6 +646,14 @@ def toolchain_search_path(vc_compiler_path): if vc_compiler_path: result = [os.environ.get('PATH')] result.extend(vc_compiler_path) + + # Also add in the location to which `mach bootstrap` or + # `mach artifact toolchain` installs clang. + mozbuild_state_dir = os.environ.get('MOZBUILD_STATE_PATH', + os.path.expanduser(os.path.join('~', '.mozbuild'))) + bootstrap_clang_path = os.path.join(mozbuild_state_dir, 'clang', 'bin') + result.append(bootstrap_clang_path) + # We're going to alter PATH for good in windows.configure, but we also # need to do it for the valid_compiler() check below. os.environ['PATH'] = os.pathsep.join(result)