Convert --clang_dir and --disable_clang to --defines
This commit is contained in:
parent
26e4ce30bb
commit
098d72b741
4 changed files with 39 additions and 21 deletions
|
@ -26,6 +26,7 @@ def main():
|
||||||
os.chdir(SOURCE_ROOT)
|
os.chdir(SOURCE_ROOT)
|
||||||
|
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
|
defines = args_to_defines(args)
|
||||||
if not args.yes and PLATFORM != 'win32':
|
if not args.yes and PLATFORM != 'win32':
|
||||||
check_root()
|
check_root()
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
|
@ -63,7 +64,7 @@ def main():
|
||||||
|
|
||||||
create_chrome_version_h()
|
create_chrome_version_h()
|
||||||
touch_config_gypi()
|
touch_config_gypi()
|
||||||
run_update()
|
run_update(defines)
|
||||||
update_electron_modules('spec', args.target_arch)
|
update_electron_modules('spec', args.target_arch)
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,6 +103,16 @@ def parse_args():
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
def args_to_defines(args):
|
||||||
|
defines = ''
|
||||||
|
if args.disable_clang:
|
||||||
|
defines += ' clang=0'
|
||||||
|
if args.clang_dir:
|
||||||
|
defines += ' make_clang_dir=' + args.clang_dir
|
||||||
|
defines += ' clang_use_chrome_plugins=0'
|
||||||
|
return defines
|
||||||
|
|
||||||
|
|
||||||
def check_root():
|
def check_root():
|
||||||
if os.geteuid() == 0:
|
if os.geteuid() == 0:
|
||||||
print "We suggest not running this as root, unless you're really sure."
|
print "We suggest not running this as root, unless you're really sure."
|
||||||
|
@ -179,14 +190,12 @@ def update_win32_python():
|
||||||
execute_stdout(['git', 'clone', PYTHON_26_URL])
|
execute_stdout(['git', 'clone', PYTHON_26_URL])
|
||||||
|
|
||||||
|
|
||||||
def build_libchromiumcontent(verbose, target_arch, disable_clang, clang_dir):
|
def build_libchromiumcontent(verbose, target_arch, defines):
|
||||||
args = [os.path.join(SOURCE_ROOT, 'script', 'build-libchromiumcontent.py')]
|
args = [os.path.join(SOURCE_ROOT, 'script', 'build-libchromiumcontent.py')]
|
||||||
if verbose:
|
if verbose:
|
||||||
args += ['-v']
|
args += ['-v']
|
||||||
if disable_clang:
|
if defines:
|
||||||
args += ['--disable_clang']
|
args += ['--defines', defines]
|
||||||
if clang_dir:
|
|
||||||
args += ['--clang_dir', clang_dir]
|
|
||||||
execute_stdout(args + ['--target_arch', target_arch])
|
execute_stdout(args + ['--target_arch', target_arch])
|
||||||
|
|
||||||
|
|
||||||
|
@ -234,9 +243,9 @@ def touch_config_gypi():
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
|
||||||
|
|
||||||
def run_update():
|
def run_update(defines):
|
||||||
update = os.path.join(SOURCE_ROOT, 'script', 'update.py')
|
update = os.path.join(SOURCE_ROOT, 'script', 'update.py')
|
||||||
execute_stdout([sys.executable, update])
|
execute_stdout([sys.executable, update, '--defines', defines])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -18,14 +18,8 @@ def main():
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
enable_verbose_mode()
|
enable_verbose_mode()
|
||||||
|
|
||||||
extra_update_args = []
|
|
||||||
if args.disable_clang:
|
|
||||||
extra_update_args += ['--disable_clang']
|
|
||||||
if args.clang_dir:
|
|
||||||
extra_update_args += ['--clang_dir', args.clang_dir]
|
|
||||||
|
|
||||||
# ./script/bootstrap
|
# ./script/bootstrap
|
||||||
# ./script/update -t x64
|
# ./script/update -t x64 --defines=''
|
||||||
# ./script/build --no_shared_library -t x64
|
# ./script/build --no_shared_library -t x64
|
||||||
# ./script/create-dist -c static_library -t x64 --no_zip
|
# ./script/create-dist -c static_library -t x64 --no_zip
|
||||||
script_dir = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
script_dir = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
||||||
|
@ -35,8 +29,8 @@ def main():
|
||||||
build = os.path.join(script_dir, 'build')
|
build = os.path.join(script_dir, 'build')
|
||||||
create_dist = os.path.join(script_dir, 'create-dist')
|
create_dist = os.path.join(script_dir, 'create-dist')
|
||||||
execute_stdout([sys.executable, bootstrap])
|
execute_stdout([sys.executable, bootstrap])
|
||||||
execute_stdout([sys.executable, update, '-t', args.target_arch] +
|
execute_stdout([sys.executable, update, '-t', args.target_arch,
|
||||||
extra_update_args)
|
'--defines', args.defines])
|
||||||
execute_stdout([sys.executable, build, '-R', '-t', args.target_arch])
|
execute_stdout([sys.executable, build, '-R', '-t', args.target_arch])
|
||||||
execute_stdout([sys.executable, create_dist, '-c', 'static_library',
|
execute_stdout([sys.executable, create_dist, '-c', 'static_library',
|
||||||
'--no_zip', '-t', args.target_arch])
|
'--no_zip', '-t', args.target_arch])
|
||||||
|
@ -46,9 +40,8 @@ def parse_args():
|
||||||
parser = argparse.ArgumentParser(description='Build libchromiumcontent')
|
parser = argparse.ArgumentParser(description='Build libchromiumcontent')
|
||||||
parser.add_argument('--target_arch',
|
parser.add_argument('--target_arch',
|
||||||
help='Specify the arch to build for')
|
help='Specify the arch to build for')
|
||||||
parser.add_argument('--clang_dir', default='', help='Path to clang binaries')
|
parser.add_argument('--defines', default='',
|
||||||
parser.add_argument('--disable_clang', action='store_true',
|
help='The definetions passed to gyp')
|
||||||
help='Use compilers other than clang for building')
|
|
||||||
parser.add_argument('-v', '--verbose', action='store_true',
|
parser.add_argument('-v', '--verbose', action='store_true',
|
||||||
help='Prints the output of the subprocesses')
|
help='Prints the output of the subprocesses')
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import argparse
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -23,6 +24,13 @@ def main():
|
||||||
return update_gyp()
|
return update_gyp()
|
||||||
|
|
||||||
|
|
||||||
|
def parse_args():
|
||||||
|
parser = argparse.ArgumentParser(description='Update build configurations')
|
||||||
|
parser.add_argument('--defines', default='',
|
||||||
|
help='The definetions passed to gyp')
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def update_external_binaries():
|
def update_external_binaries():
|
||||||
uf = os.path.join('script', 'update-external-binaries.py')
|
uf = os.path.join('script', 'update-external-binaries.py')
|
||||||
subprocess.check_call([sys.executable, uf])
|
subprocess.check_call([sys.executable, uf])
|
||||||
|
@ -60,6 +68,7 @@ def run_gyp(target_arch, component):
|
||||||
mas_build = 1
|
mas_build = 1
|
||||||
else:
|
else:
|
||||||
mas_build = 0
|
mas_build = 0
|
||||||
|
|
||||||
defines = [
|
defines = [
|
||||||
'-Dlibchromiumcontent_component={0}'.format(component),
|
'-Dlibchromiumcontent_component={0}'.format(component),
|
||||||
'-Dtarget_arch={0}'.format(target_arch),
|
'-Dtarget_arch={0}'.format(target_arch),
|
||||||
|
@ -67,6 +76,13 @@ def run_gyp(target_arch, component):
|
||||||
'-Dlibrary=static_library',
|
'-Dlibrary=static_library',
|
||||||
'-Dmas_build={0}'.format(mas_build),
|
'-Dmas_build={0}'.format(mas_build),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Add the defines passed from command line.
|
||||||
|
args = parse_args()
|
||||||
|
for define in [d.strip() for d in args.defines.split(' ')]:
|
||||||
|
if define:
|
||||||
|
defines += ['-D' + define]
|
||||||
|
|
||||||
return subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.',
|
return subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.',
|
||||||
'electron.gyp', '-Icommon.gypi'] + defines, env=env)
|
'electron.gyp', '-Icommon.gypi'] + defines, env=env)
|
||||||
|
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 3d168efd1d27d4ac3869beac6290c5066c392721
|
Subproject commit 9a5b443e4953fa51ddd0a8d4739e60edf0a666a3
|
Loading…
Reference in a new issue