Bug 1467327 - Use bootstrapped clang if no system clang is found. r=froydnj

--HG--
extra : rebase_source : 4e646c27321d19d2d44df9911e5ef6fdb060ac48
This commit is contained in:
Mike Hommey 2018-06-07 09:57:36 +09:00
Родитель fe5f3fd914
Коммит e1e5972b07
1 изменённых файлов: 15 добавлений и 10 удалений

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

@ -638,22 +638,27 @@ def vc_compiler_path(host, target, vs_major_version, env, vs_release_name):
@depends(vc_compiler_path)
@imports('os')
@imports(_from='os', _import='environ')
def toolchain_search_path(vc_compiler_path):
result = [environ.get('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)
# Also add in the location to which `mach bootstrap` or
# `mach artifact toolchain` installs clang.
mozbuild_state_dir = 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)
if vc_compiler_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)
return result
# need to do it for the valid_compiler() check below. This is only needed
# on Windows, where MSVC needs PATH set to find dlls.
environ['PATH'] = os.pathsep.join(result)
return result
@template