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

Unified Diff: pylib/gyp/generator/msvs.py

Issue 9390017: Added support of the PlatformToolset property to Gyp (MSBuild only). (Closed) Base URL: http://git.chromium.org/external/gyp.git@master
Patch Set: Created 8 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698