Add --build_libchromiumcontent option
This commit is contained in:
parent
f1edd88e56
commit
26c0ad1c2f
3 changed files with 73 additions and 3 deletions
|
@ -33,6 +33,19 @@ def main():
|
||||||
if sys.platform == 'cygwin':
|
if sys.platform == 'cygwin':
|
||||||
update_win32_python()
|
update_win32_python()
|
||||||
|
|
||||||
|
libcc_source_path = args.libcc_source_path
|
||||||
|
libcc_shared_library_path = args.libcc_shared_library_path
|
||||||
|
libcc_static_library_path = args.libcc_static_library_path
|
||||||
|
|
||||||
|
# Redirect to use local libchromiumcontent build.
|
||||||
|
if args.build_libchromiumcontent:
|
||||||
|
build_libchromiumcontent(args.verbose, args.target_arch)
|
||||||
|
dist_dir = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
||||||
|
'libchromiumcontent', 'dist', 'main')
|
||||||
|
libcc_source_path = os.path.join(dist_dir, 'src')
|
||||||
|
libcc_shared_library_path = os.path.join(dist_dir, 'shared_library')
|
||||||
|
libcc_static_library_path = os.path.join(dist_dir, 'static_library')
|
||||||
|
|
||||||
if PLATFORM != 'win32':
|
if PLATFORM != 'win32':
|
||||||
update_clang()
|
update_clang()
|
||||||
|
|
||||||
|
@ -40,8 +53,8 @@ def main():
|
||||||
setup_python_libs()
|
setup_python_libs()
|
||||||
update_node_modules('.')
|
update_node_modules('.')
|
||||||
bootstrap_brightray(args.dev, args.url, args.target_arch,
|
bootstrap_brightray(args.dev, args.url, args.target_arch,
|
||||||
args.libcc_source_path, args.libcc_shared_library_path,
|
libcc_source_path, libcc_shared_library_path,
|
||||||
args.libcc_static_library_path)
|
libcc_static_library_path)
|
||||||
|
|
||||||
if PLATFORM == 'linux':
|
if PLATFORM == 'linux':
|
||||||
download_sysroot(args.target_arch)
|
download_sysroot(args.target_arch)
|
||||||
|
@ -71,6 +84,8 @@ def parse_args():
|
||||||
'prompts.')
|
'prompts.')
|
||||||
parser.add_argument('--target_arch', default=get_target_arch(),
|
parser.add_argument('--target_arch', default=get_target_arch(),
|
||||||
help='Manually specify the arch to build for')
|
help='Manually specify the arch to build for')
|
||||||
|
parser.add_argument('--build_libchromiumcontent', action='store_true',
|
||||||
|
help='Build local version of libchromiumcontent')
|
||||||
parser.add_argument('--libcc_source_path', required=False,
|
parser.add_argument('--libcc_source_path', required=False,
|
||||||
help='The source path of libchromiumcontent. ' \
|
help='The source path of libchromiumcontent. ' \
|
||||||
'NOTE: All options of libchromiumcontent are ' \
|
'NOTE: All options of libchromiumcontent are ' \
|
||||||
|
@ -159,6 +174,13 @@ def update_win32_python():
|
||||||
execute_stdout(['git', 'clone', PYTHON_26_URL])
|
execute_stdout(['git', 'clone', PYTHON_26_URL])
|
||||||
|
|
||||||
|
|
||||||
|
def build_libchromiumcontent(is_verbose_mode, target_arch):
|
||||||
|
args = [os.path.join(SOURCE_ROOT, 'script', 'build-libchromiumcontent.py')]
|
||||||
|
if is_verbose_mode:
|
||||||
|
args += ['-v']
|
||||||
|
execute_stdout(args + ['--target_arch', target_arch])
|
||||||
|
|
||||||
|
|
||||||
def update_clang():
|
def update_clang():
|
||||||
execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'update-clang.sh')])
|
execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'update-clang.sh')])
|
||||||
|
|
||||||
|
|
48
script/build-libchromiumcontent.py
Executable file
48
script/build-libchromiumcontent.py
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from lib.config import enable_verbose_mode, get_target_arch
|
||||||
|
from lib.util import execute_stdout
|
||||||
|
|
||||||
|
|
||||||
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
os.chdir(SOURCE_ROOT)
|
||||||
|
|
||||||
|
args = parse_args()
|
||||||
|
if args.verbose:
|
||||||
|
enable_verbose_mode()
|
||||||
|
|
||||||
|
# ./script/bootstrap
|
||||||
|
# ./script/update -t x64
|
||||||
|
# ./script/build --no_shared_library -t x64
|
||||||
|
# ./script/create-dist -c static_library -t x64 --no_zip
|
||||||
|
script_dir = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
||||||
|
'libchromiumcontent', 'script')
|
||||||
|
bootstrap = os.path.join(script_dir, 'bootstrap')
|
||||||
|
update = os.path.join(script_dir, 'update')
|
||||||
|
build = os.path.join(script_dir, 'build')
|
||||||
|
create_dist = os.path.join(script_dir, 'create-dist')
|
||||||
|
execute_stdout([sys.executable, bootstrap])
|
||||||
|
execute_stdout([sys.executable, update, '-t', args.target_arch])
|
||||||
|
execute_stdout([sys.executable, build, '-R', '-t', args.target_arch])
|
||||||
|
execute_stdout([sys.executable, create_dist, '-c', 'static_library',
|
||||||
|
'--no_zip', '-t', args.target_arch])
|
||||||
|
|
||||||
|
|
||||||
|
def parse_args():
|
||||||
|
parser = argparse.ArgumentParser(description='Build libchromiumcontent')
|
||||||
|
parser.add_argument('--target_arch',
|
||||||
|
help='Specify the arch to build for')
|
||||||
|
parser.add_argument('-v', '--verbose', action='store_true',
|
||||||
|
help='Prints the output of the subprocesses')
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main())
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 8dbaeed37b9c4fb8ae985670b142f659bb265fb4
|
Subproject commit 3d168efd1d27d4ac3869beac6290c5066c392721
|
Loading…
Reference in a new issue