From 6175380bc0f229eb55a14372391562f97db3c3e8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 18:26:15 +0800 Subject: [PATCH] Explicit set default arch --- script/bootstrap.py | 4 ++-- script/lib/config.py | 18 ++++++++++++------ vendor/brightray | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index 5dd2488902ec..4ca7526b7c6d 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -5,7 +5,7 @@ import os import sys from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ - enable_verbose_mode, is_verbose_mode + enable_verbose_mode, is_verbose_mode, get_target_arch from lib.util import execute_stdout, scoped_cwd @@ -52,7 +52,7 @@ def parse_args(): action='store_true', help='Run non-interactively by assuming "yes" to all ' \ 'prompts.') - parser.add_argument('--target_arch', default='default', + parser.add_argument('--target_arch', default=get_target_arch(), help='Manually specify the arch to build for') return parser.parse_args() diff --git a/script/lib/config.py b/script/lib/config.py index 250c362206b7..a45822aa1727 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import errno import os import platform import sys @@ -30,12 +31,17 @@ def get_target_arch(): return 'x64' # On Windows it depends on user. elif PLATFORM == 'win32': - target_arch_path = os.path.join(__file__, '..', '..', '..', 'vendor', - 'brightray', 'vendor', 'download', - 'libchromiumcontent', '.target_arch') - with open(os.path.normpath(target_arch_path)) as f: - target_arch = f.read().strip() - return target_arch + try: + target_arch_path = os.path.join(__file__, '..', '..', '..', 'vendor', + 'brightray', 'vendor', 'download', + 'libchromiumcontent', '.target_arch') + with open(os.path.normpath(target_arch_path)) as f: + return f.read().strip() + except IOError as e: + if e.errno != errno.ENOENT: + raise + # Build 32bit by default. + return 'ia32' # Maybe we will support other platforms in future. else: return 'x64' diff --git a/vendor/brightray b/vendor/brightray index 33367e86d33f..d88754641e69 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 33367e86d33f2ba8bf3d9dc796b469e6d5855e20 +Subproject commit d88754641e6905eeb8a62b102323369645768b53