Index: pylib/gyp/generator/msvs.py |
diff --git a/pylib/gyp/generator/msvs.py b/pylib/gyp/generator/msvs.py |
index a4c6efd1a466c97afbffd00938fb8e63a0727dfa..ab814c7794cc54037c40f588126c7b84afce696f 100644 |
--- a/pylib/gyp/generator/msvs.py |
+++ b/pylib/gyp/generator/msvs.py |
@@ -1661,6 +1661,11 @@ def CalculateVariables(default_variables, params): |
# Set a variable so conditions can be based on msvs_version. |
default_variables['MSVS_VERSION'] = msvs_version.ShortName() |
+ # Use the platform toolset specified in the environment (MSBuild only) |
+ msvs_toolset = generator_flags.get( |
+ 'msvs_toolset', os.environ.get('GYP_MSVS_TOOLSET', 'auto')) |
+ generator_flags['msvs_toolset'] = msvs_toolset |
+ |
# To determine processor word size on Windows, in addition to checking |
# PROCESSOR_ARCHITECTURE (which reflects the word size of the current |
# process), it is also necessary to check PROCESSOR_ARCITEW6432 (which |
@@ -2834,6 +2839,15 @@ def _GenerateMSBuildProject(project, options, version, generator_flags): |
content += _GetMSBuildGlobalProperties(spec, project.guid, project_file_name) |
content += import_default_section |
content += _GetMSBuildConfigurationDetails(spec, project.build_file) |
+ |
+ # Specify a platform toolset for the project if set. |
+ msvs_toolset = generator_flags.get('msvs_toolset', 'auto') |
bradn
2012/02/15 06:23:17
Rather than having this be a generator flag, could
alexeypa (please no reviews)
2012/02/17 18:11:40
This certainly makes sense. Take a look at the upd
|
+ if msvs_toolset != 'auto': |
+ content += [ |
+ ['PropertyGroup', {'Label': 'Locals'}, |
+ ['PlatformToolset', msvs_toolset], |
+ ]] |
+ |
content += import_cpp_props_section |
content += _GetMSBuildExtensions(props_files_of_rules) |
content += _GetMSBuildPropertySheets(configurations) |