Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2530)

Unified Diff: build/toolchain/win/setup_toolchain.py

Issue 1724533002: clang/gn/win: Stop running the compiler through `ninja -t msvc -e environment.foo` (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/toolchain/win/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/win/setup_toolchain.py
diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py
index a766cc1541573c8527e4c6c2efd6b72e0012177e..99585a19373b5d9c677ee41bd2d7930997b19b6b 100644
--- a/build/toolchain/win/setup_toolchain.py
+++ b/build/toolchain/win/setup_toolchain.py
@@ -155,21 +155,23 @@ def _CopyTool(source_path):
def main():
- if len(sys.argv) != 6:
+ if len(sys.argv) != 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 = 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?
@@ -184,6 +186,8 @@ def main():
if os.path.exists(os.path.join(path, 'cl.exe')):
vc_bin_dir = os.path.realpath(path)
break
+ include = ' '.join([include_prefix + p
+ for p in env['INCLUDE'].split(';')])
env_block = _FormatAsEnvironmentBlock(env)
with open('environment.' + cpu, 'wb') as f:
@@ -196,11 +200,14 @@ 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
-
+ assert include
+ assert '"' not in include
+ print 'include_flags = "%s"' % include
if __name__ == '__main__':
main()
« no previous file with comments | « build/toolchain/win/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698