Add optional verbose switch '-v' to build script. (#12118)
* Add optional verbose switch '-v' to build script. * Remove tracer comment. * Add --ninja-path switch. For compatiblity with https://github.com/electron/electron/pull/12120
This commit is contained in:
parent
e9808d138f
commit
642dc96956
1 changed files with 26 additions and 7 deletions
|
@ -5,7 +5,8 @@ import os
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from lib.config import MIPS64EL_GCC, get_target_arch, build_env
|
||||
from lib.config import MIPS64EL_GCC, get_target_arch, build_env, \
|
||||
enable_verbose_mode, is_verbose_mode
|
||||
from lib.util import electron_gyp, import_vs_env
|
||||
|
||||
|
||||
|
@ -20,14 +21,25 @@ GCLIENT_DONE = os.path.join(SOURCE_ROOT, '.gclient_done')
|
|||
def main():
|
||||
os.chdir(SOURCE_ROOT)
|
||||
|
||||
args = parse_args()
|
||||
if args.verbose:
|
||||
enable_verbose_mode()
|
||||
|
||||
# Update the VS build env.
|
||||
import_vs_env(get_target_arch())
|
||||
|
||||
ninja = os.path.join('vendor', 'depot_tools', 'ninja')
|
||||
if sys.platform == 'win32':
|
||||
ninja += '.exe'
|
||||
# decide which ninja executable to use
|
||||
ninja_path = args.ninja_path
|
||||
if not ninja_path:
|
||||
ninja_path = os.path.join('vendor', 'depot_tools', 'ninja')
|
||||
if sys.platform == 'win32':
|
||||
ninja_path += '.exe'
|
||||
|
||||
# decide how to invoke ninja
|
||||
ninja = [ninja_path]
|
||||
if is_verbose_mode():
|
||||
ninja.append('-v')
|
||||
|
||||
args = parse_args()
|
||||
if args.libcc:
|
||||
if ('D' not in args.configuration
|
||||
or not os.path.exists(GCLIENT_DONE)
|
||||
|
@ -39,12 +51,12 @@ def main():
|
|||
script = os.path.join(LIBCC_SOURCE_ROOT, 'script', 'build')
|
||||
subprocess.check_call([sys.executable, script, '-D', '-t',
|
||||
get_target_arch()])
|
||||
subprocess.check_call([ninja, '-C', LIBCC_DIST_MAIN])
|
||||
subprocess.check_call(ninja + ['-C', LIBCC_DIST_MAIN])
|
||||
|
||||
env = build_env()
|
||||
for config in args.configuration:
|
||||
build_path = os.path.join('out', config[0])
|
||||
ret = subprocess.call([ninja, '-C', build_path, args.target], env=env)
|
||||
ret = subprocess.call(ninja + ['-C', build_path, args.target], env=env)
|
||||
if ret != 0:
|
||||
sys.exit(ret)
|
||||
|
||||
|
@ -56,6 +68,10 @@ def parse_args():
|
|||
nargs='+',
|
||||
default=CONFIGURATIONS,
|
||||
required=False)
|
||||
parser.add_argument('-v', '--verbose',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='Verbose output')
|
||||
parser.add_argument('-t', '--target',
|
||||
help='Build specified target',
|
||||
default=electron_gyp()['project_name%'],
|
||||
|
@ -67,6 +83,9 @@ def parse_args():
|
|||
'-d --debug_libchromiumcontent.'
|
||||
),
|
||||
action='store_true', default=False)
|
||||
parser.add_argument('--ninja-path',
|
||||
help='Path of ninja command to use.',
|
||||
required=False)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue