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.
This commit is contained in:
Nathan Froyd 2018-02-27 20:13:16 -05:00
Родитель d8f2b1d3a8
Коммит 429ce7900b
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

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