Index: pylib/gyp/generator/ninja.py |
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py |
index 4c2a55e40fa247b4f5fcaec9f9e80568864da618..2cbc5fef3da5efd26a5c1b0c9c4062ad39180c0a 100644 |
--- a/pylib/gyp/generator/ninja.py |
+++ b/pylib/gyp/generator/ninja.py |
@@ -1682,6 +1682,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, |
cxx_host = None |
cc_host_global_setting = None |
cxx_host_global_setting = None |
+ clang_cl = None |
build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) |
make_global_settings = data[build_file].get('make_global_settings', []) |
@@ -1701,6 +1702,8 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, |
cxx_host_global_setting = value |
if key.endswith('_wrapper'): |
wrappers[key[:-len('_wrapper')]] = os.path.join(build_to_root, value) |
+ if key == 'clang-cl': |
+ clang_cl = os.path.join(build_to_root, value) |
# Support wrappers from environment variables too. |
for key, value in os.environ.iteritems(): |
@@ -1713,9 +1716,15 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, |
cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles( |
toplevel_build, generator_flags, OpenOutput) |
for arch, path in cl_paths.iteritems(): |
- master_ninja.variable( |
- 'cl_' + arch, CommandWithWrapper('CC', wrappers, |
- QuoteShellArgument(path, flavor))) |
+ if clang_cl: |
+ # If we have clang-cl, use that instead. |
+ path = clang_cl |
Nico
2014/01/28 17:48:20
Can't you use one of the existing keys (CC or CXX,
scottmg
2014/01/28 17:59:02
That sounds better to me.
|
+ command = CommandWithWrapper('CC', wrappers, |
+ QuoteShellArgument(path, 'win')) |
+ if clang_cl: |
+ # Use clang-cl to cross-compile for x86 or x86_64. |
+ command += (' -m32' if arch == 'x86' else ' -m64') |
scottmg
2014/01/28 17:59:02
Slightly concerned about this as it's expecting a
|
+ master_ninja.variable('cl_' + arch, command) |
cc = GetEnvironFallback(['CC_target', 'CC'], cc) |
master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc)) |