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..b2ebb356c7d7cc29a251561b00860453aa32989c 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 |
@@ -183,7 +191,9 @@ def main(): |
assert vc_bin_dir |
print 'vc_bin_dir = "%s"' % vc_bin_dir |
- |
+ if include_prefix: |
+ assert include |
scottmg
2016/02/25 03:40:15
Maybe assert " not in include. But I guess we don'
Nico
2016/02/25 03:45:41
Will do or not, I guess. It'll be a surprise!
|
+ print 'include_flags = "%s"' % include |
if __name__ == '__main__': |
main() |