Add x64 build support to automate.py.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1409 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2013-08-23 16:22:11 +00:00
parent 9e9ef3311d
commit 34797e3876
1 changed files with 35 additions and 11 deletions

View File

@ -201,6 +201,9 @@ parser.add_option('--no-distrib-archive',
parser.add_option('--ninja-build', parser.add_option('--ninja-build',
action='store_true', dest='ninjabuild', default=False, action='store_true', dest='ninjabuild', default=False,
help="build using ninja") help="build using ninja")
parser.add_option('--x64-build',
action='store_true', dest='x64build', default=False,
help='build for 64-bit systems (Windows and Mac OS X only)')
parser.add_option('--clean-artifacts', parser.add_option('--clean-artifacts',
action='store_true', dest='cleanartifacts', default=False, action='store_true', dest='cleanartifacts', default=False,
help='clean the artifacts output directory') help='clean the artifacts output directory')
@ -209,6 +212,15 @@ parser.add_option('--dry-run',
help="output commands without executing them") help="output commands without executing them")
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
# Test the operating system.
platform = '';
if sys.platform == 'win32':
platform = 'windows'
elif sys.platform == 'darwin':
platform = 'macosx'
elif sys.platform.startswith('linux'):
platform = 'linux'
# the downloaddir option is required # the downloaddir option is required
if options.downloaddir is None: if options.downloaddir is None:
parser.print_help(sys.stderr) parser.print_help(sys.stderr)
@ -221,6 +233,14 @@ if (options.noreleasebuild and (options.minimaldistrib or options.minimaldistrib
parser.print_help(sys.stderr) parser.print_help(sys.stderr)
sys.exit() sys.exit()
if options.x64build and platform != 'windows' and platform != 'macosx':
print 'The x64 build option is only used on Windows and Mac OS X.'
sys.exit()
if options.x64build and platform == 'windows' and not options.ninjabuild:
print 'The x64 build option on Windows requires ninja.'
sys.exit()
# script directory # script directory
script_dir = os.path.dirname(__file__) script_dir = os.path.dirname(__file__)
@ -229,15 +249,6 @@ if not os.path.exists(download_dir):
# create the download directory # create the download directory
os.makedirs(download_dir) os.makedirs(download_dir)
# Test the operating system.
platform = '';
if sys.platform == 'win32':
platform = 'windows'
elif sys.platform == 'darwin':
platform = 'macosx'
elif sys.platform.startswith('linux'):
platform = 'linux'
# set the expected script extension # set the expected script extension
if platform == 'windows': if platform == 'windows':
script_ext = '.bat' script_ext = '.bat'
@ -485,6 +496,11 @@ if any_changed or options.forceupdate:
# create CEF projects # create CEF projects
if options.ninjabuild: if options.ninjabuild:
os.environ['GYP_GENERATORS'] = 'ninja' os.environ['GYP_GENERATORS'] = 'ninja'
if options.x64build:
if 'GYP_DEFINES' in os.environ.keys():
os.environ['GYP_DEFINES'] = os.environ['GYP_DEFINES'] + ' ' + 'target_arch=x64'
else:
os.environ['GYP_DEFINES'] = 'target_arch=x64'
path = os.path.join(cef_src_dir, 'cef_create_projects'+script_ext) path = os.path.join(cef_src_dir, 'cef_create_projects'+script_ext)
run(path, cef_src_dir, depot_tools_dir) run(path, cef_src_dir, depot_tools_dir)
@ -492,13 +508,19 @@ if any_changed or options.forcebuild:
if options.ninjabuild: if options.ninjabuild:
command = 'ninja -C ' command = 'ninja -C '
target = ' cefclient' target = ' cefclient'
build_dir_suffix = ''
if platform == 'windows':
build_dir_suffix = '_x64'
if not options.nodebugbuild: if not options.nodebugbuild:
# make CEF Debug build # make CEF Debug build
run(command + os.path.join('out', 'Debug') + target, chromium_src_dir, depot_tools_dir) run(command + os.path.join('out', 'Debug' + build_dir_suffix) + target, \
chromium_src_dir, depot_tools_dir)
if not options.noreleasebuild: if not options.noreleasebuild:
# make CEF Release build # make CEF Release build
run(command + os.path.join('out', 'Release') + target, chromium_src_dir, depot_tools_dir) run(command + os.path.join('out', 'Release' + build_dir_suffix) + target, \
chromium_src_dir, depot_tools_dir)
else: else:
path = os.path.join(cef_tools_dir, 'build_projects'+script_ext) path = os.path.join(cef_tools_dir, 'build_projects'+script_ext)
@ -539,6 +561,8 @@ if (any_changed or options.forcedistrib) and not options.nodistrib:
path = path + ' --allow-partial' path = path + ' --allow-partial'
if options.ninjabuild: if options.ninjabuild:
path = path + ' --ninja-build' path = path + ' --ninja-build'
if options.x64build:
path = path + ' --x64-build'
if type == 'minimal': if type == 'minimal':
path = path + ' --minimal' path = path + ' --minimal'