Explicit set default arch

This commit is contained in:
Cheng Zhao 2015-04-11 18:26:15 +08:00
parent de016e72a5
commit 6175380bc0
3 changed files with 15 additions and 9 deletions

View file

@ -5,7 +5,7 @@ import os
import sys import sys
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ 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 from lib.util import execute_stdout, scoped_cwd
@ -52,7 +52,7 @@ def parse_args():
action='store_true', action='store_true',
help='Run non-interactively by assuming "yes" to all ' \ help='Run non-interactively by assuming "yes" to all ' \
'prompts.') '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') help='Manually specify the arch to build for')
return parser.parse_args() return parser.parse_args()

View file

@ -1,5 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
import errno
import os import os
import platform import platform
import sys import sys
@ -30,12 +31,17 @@ def get_target_arch():
return 'x64' return 'x64'
# On Windows it depends on user. # On Windows it depends on user.
elif PLATFORM == 'win32': elif PLATFORM == 'win32':
target_arch_path = os.path.join(__file__, '..', '..', '..', 'vendor', try:
'brightray', 'vendor', 'download', target_arch_path = os.path.join(__file__, '..', '..', '..', 'vendor',
'libchromiumcontent', '.target_arch') 'brightray', 'vendor', 'download',
with open(os.path.normpath(target_arch_path)) as f: 'libchromiumcontent', '.target_arch')
target_arch = f.read().strip() with open(os.path.normpath(target_arch_path)) as f:
return target_arch 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. # Maybe we will support other platforms in future.
else: else:
return 'x64' return 'x64'

2
vendor/brightray vendored

@ -1 +1 @@
Subproject commit 33367e86d33f2ba8bf3d9dc796b469e6d5855e20 Subproject commit d88754641e6905eeb8a62b102323369645768b53