Ignore CC and CXX if user didn't change build configuration

This commit is contained in:
Cheng Zhao 2016-05-03 09:31:39 +09:00
parent 0567f09d6d
commit 49eed1ebb9

View file

@ -49,8 +49,11 @@ def main():
libcc_shared_library_path = os.path.join(dist_dir, 'shared_library') libcc_shared_library_path = os.path.join(dist_dir, 'shared_library')
libcc_static_library_path = os.path.join(dist_dir, 'static_library') libcc_static_library_path = os.path.join(dist_dir, 'static_library')
update_clang()
if PLATFORM != 'win32' and not args.disable_clang and args.clang_dir == '': if PLATFORM != 'win32' and not args.disable_clang and args.clang_dir == '':
update_clang() # Build with prebuilt clang.
set_clang_env(os.environ)
setup_python_libs() setup_python_libs()
update_node_modules('.') update_node_modules('.')
@ -151,15 +154,19 @@ def bootstrap_brightray(is_dev, url, target_arch, libcc_source_path,
execute_stdout([sys.executable, bootstrap] + args) execute_stdout([sys.executable, bootstrap] + args)
def set_clang_env(env):
llvm_dir = os.path.join(SOURCE_ROOT, 'vendor', 'llvm-build',
'Release+Asserts', 'bin')
env['CC'] = os.path.join(llvm_dir, 'clang')
env['CXX'] = os.path.join(llvm_dir, 'clang++')
def update_node_modules(dirname, env=None): def update_node_modules(dirname, env=None):
if env is None: if env is None:
env = os.environ.copy() env = os.environ.copy()
if PLATFORM == 'linux': if PLATFORM == 'linux':
# Use prebuilt clang for building native modules. # Use prebuilt clang for building native modules.
llvm_dir = os.path.join(SOURCE_ROOT, 'vendor', 'llvm-build', set_clang_env(env)
'Release+Asserts', 'bin')
env['CC'] = os.path.join(llvm_dir, 'clang')
env['CXX'] = os.path.join(llvm_dir, 'clang++')
env['npm_config_clang'] = '1' env['npm_config_clang'] = '1'
with scoped_cwd(dirname): with scoped_cwd(dirname):
args = [NPM, 'install'] args = [NPM, 'install']