Skip to content

Commit

Permalink
Explicit set default arch
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Apr 11, 2015
1 parent de016e7 commit 6175380
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions script/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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


Expand Down Expand Up @@ -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()

Expand Down
18 changes: 12 additions & 6 deletions script/lib/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python

import errno
import os
import platform
import sys
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion vendor/brightray

0 comments on commit 6175380

Please sign in to comment.