diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 17:48:26 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 17:48:26 +0000 |
commit | e7a32a13a89efea50f38288ebeadbc3189d971de (patch) | |
tree | 99d2dae0e8fa1f5a1a6992a821438fcde5aacf73 /build/gyp_chromium | |
parent | d16a5b4dd2c80719e1b0e1c05e8dea0a004b9b67 (diff) | |
download | chromium_src-e7a32a13a89efea50f38288ebeadbc3189d971de.zip chromium_src-e7a32a13a89efea50f38288ebeadbc3189d971de.tar.gz chromium_src-e7a32a13a89efea50f38288ebeadbc3189d971de.tar.bz2 |
gyp_chromium integration for automatic toolchain
When opting in via GYP_MSVS_USE_SYSTEM_TOOLCHAIN=0, set
environment variables that tell gyp how to find the automatic
toolchain in third_party/win_toolchain.
R=maruel@chromium.org
BUG=323300
Review URL: https://codereview.chromium.org/100613002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/gyp_chromium')
-rwxr-xr-x | build/gyp_chromium | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/build/gyp_chromium b/build/gyp_chromium index a03fa34..c6d1afe 100755 --- a/build/gyp_chromium +++ b/build/gyp_chromium @@ -10,6 +10,7 @@ import glob import gyp_helper import os +import pipes import shlex import subprocess import sys @@ -150,6 +151,34 @@ if __name__ == '__main__': not 'OS=ios' in os.environ.get('GYP_DEFINES', []): os.environ['GYP_GENERATORS'] = 'ninja' + # If using ninja on windows, and not opting out of the the automatic + # toolchain, then set up variables for the automatic toolchain. Opt-out is + # on by default, for now. + if (sys.platform in ('win32', 'cygwin') and + os.environ.get('GYP_GENERATORS') == 'ninja' and + os.environ.get('GYP_MSVS_USE_SYSTEM_TOOLCHAIN', '1') != '1'): + # For now, call the acquisition script here so that there's only one + # opt-in step required. This will be moved to a separate DEPS step once + # it's on by default. + subprocess.check_call([ + sys.executable, + os.path.normpath(os.path.join(script_dir, '..', 'tools', 'win', + 'toolchain', + 'get_toolchain_if_necessary.py'))]) + toolchain = os.path.normpath(os.path.join( + script_dir, '..', 'third_party', 'win_toolchain', 'files')) + os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain + os.environ['GYP_MSVS_VERSION'] = '2013' + # We need to make sure windows_sdk_path is set to the automated toolchain + # values in GYP_DEFINES, but don't want to override any other values there. + gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES')) + win8sdk = os.path.join(toolchain, 'win8sdk') + gyp_defines_dict['windows_sdk_path'] = win8sdk + os.environ['WINDOWSSDKDIR'] = win8sdk + os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v))) + for k, v in gyp_defines_dict.iteritems()) + print('Using automatic toolchain in %s.' % toolchain) + # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check # to enfore syntax checking. syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |