Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Unified Diff: mojo/tools/mojob.py

Issue 847863004: mojob.py: explicitly select CPU architecture. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Quotes Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/tools/mopy/config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/mojob.py
diff --git a/mojo/tools/mojob.py b/mojo/tools/mojob.py
index ff1cb285816caa8ef57e921b0642451b03643dbc..5bb57edec8c235d31b20866c656b543dc1c4744c 100755
--- a/mojo/tools/mojob.py
+++ b/mojo/tools/mojob.py
@@ -26,6 +26,10 @@ def _args_to_config(args):
elif args.chromeos:
target_os = Config.OS_CHROMEOS
+ if args.cpu_arch is None and args.android:
+ args.cpu_arch = 'arm'
+ target_arch = args.cpu_arch
+
additional_args = {}
if 'clang' in args:
@@ -52,8 +56,7 @@ def _args_to_config(args):
if 'with_dart' in args:
additional_args['with_dart'] = args.with_dart
- if 'nacl' in args:
- additional_args['use_nacl'] = args.nacl
+ additional_args['use_nacl'] = args.nacl
if 'dry_run' in args:
additional_args['dry_run'] = args.dry_run
@@ -67,7 +70,8 @@ def _args_to_config(args):
if 'test_results_server' in args:
additional_args['test_results_server'] = args.test_results_server
- return Config(target_os=target_os, is_debug=args.debug, **additional_args)
+ return Config(target_os=target_os, target_arch=target_arch,
+ is_debug=args.debug, **additional_args)
def _get_out_dir(config):
@@ -107,11 +111,13 @@ def gn(config):
gn_args.append('mojo_use_nacl=true')
if config.target_os == Config.OS_ANDROID:
- gn_args.append(r'''os=\"android\" cpu_arch=\"arm\"''')
+ gn_args.append(r'''os=\"android\"''')
elif config.target_os == Config.OS_CHROMEOS:
gn_args.append(r'''os=\"chromeos\" ui_base_build_ime=false
use_system_harfbuzz=false''')
+ gn_args.append(r'''cpu_arch=\"%s\"''' % config.target_arch)
+
out_dir = _get_out_dir(config)
command.append(out_dir)
command.append('--args="%s"' % ' '.join(gn_args))
@@ -211,6 +217,13 @@ def main():
os_group.add_argument('--chromeos', help='Build for ChromeOS',
action='store_true')
+ parent_parser.add_argument('--cpu-arch',
+ help='CPU architecture to build for.',
+ choices=['x64', 'x86', 'arm'])
+
+ parent_parser.add_argument('--nacl', help='Add in NaCl', default=False,
+ action='store_true')
+
subparsers = parser.add_subparsers()
sync_parser = subparsers.add_parser('sync', parents=[parent_parser],
@@ -222,7 +235,6 @@ def main():
gn_parser.set_defaults(func=gn)
gn_parser.add_argument('--with-dart', help='Configure the Dart bindings',
action='store_true')
- gn_parser.add_argument('--nacl', help='Add in NaCl', action='store_true')
clang_group = gn_parser.add_mutually_exclusive_group()
clang_group.add_argument('--clang', help='Use Clang (default)', default=None,
action='store_true')
« no previous file with comments | « no previous file | mojo/tools/mopy/config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698