| Index: build/toolchain/win/setup_toolchain.py
|
| diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py
|
| index 1e20387b0b240e987b22e85898c9368d8b0b0b9a..1612b22ca437b60b8fef6dc78aadde1495cae620 100644
|
| --- a/build/toolchain/win/setup_toolchain.py
|
| +++ b/build/toolchain/win/setup_toolchain.py
|
| @@ -126,21 +126,26 @@ def _CopyTool(source_path):
|
|
|
|
|
| def main():
|
| - if len(sys.argv) != 6:
|
| + if len(sys.argv) not in (6, 7):
|
| print('Usage setup_toolchain.py '
|
| '<visual studio path> <win tool path> <win sdk path> '
|
| - '<runtime dirs> <target_cpu>')
|
| + '<runtime dirs> <target_cpu>, <include prefix>')
|
| sys.exit(2)
|
| tool_source = sys.argv[2]
|
| win_sdk_path = sys.argv[3]
|
| runtime_dirs = sys.argv[4]
|
| target_cpu = sys.argv[5]
|
|
|
| + include_prefix = None
|
| + if len(sys.argv) > 6:
|
| + include_prefix = sys.argv[6]
|
| +
|
| _CopyTool(tool_source)
|
|
|
| cpus = ('x86', 'x64')
|
| assert target_cpu in cpus
|
| vc_bin_dir = ''
|
| + include = ''
|
|
|
| # TODO(scottmg|goma): Do we need an equivalent of
|
| # ninja_use_custom_environment_files?
|
| @@ -155,6 +160,9 @@ def main():
|
| if os.path.exists(os.path.join(path, 'cl.exe')):
|
| vc_bin_dir = os.path.realpath(path)
|
| break
|
| + if include_prefix:
|
| + include = ' '.join([include_prefix + p
|
| + for p in env['INCLUDE'].split(';')])
|
|
|
| # The Windows SDK include directories must be first. They both have a sal.h,
|
| # and the SDK one is newer and the SDK uses some newer features from it not
|
| @@ -179,11 +187,15 @@ def main():
|
| env['LIBPATH'] = env['LIBPATH'].replace(r'\VC\LIB', r'\VC\LIB\STORE')
|
| env_block = _FormatAsEnvironmentBlock(env)
|
| with open('environment.winrt_' + cpu, 'wb') as f:
|
| - f.write(env_block)
|
| + f.write(env_block)
|
|
|
| assert vc_bin_dir
|
| + assert '"' not in vc_bin_dir
|
| print 'vc_bin_dir = "%s"' % vc_bin_dir
|
| -
|
| + if include_prefix:
|
| + assert include
|
| + assert '"' not in include
|
| + print 'include_flags = "%s"' % include
|
|
|
| if __name__ == '__main__':
|
| main()
|
|
|