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

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

Issue 1845943002: Enabling /ZW (CompileAsWinRT) option for msvs (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Reverting incorrect quote_cmd fix 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 | « pylib/gyp/MSVSSettings.py ('k') | test/lib/TestGyp.py » ('j') | 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 bc4dfc31247b735f853eed881c858913169a328e..bf56e6b82a6c325d5be314754b07a12c6095fa1d 100644
--- a/pylib/gyp/generator/msvs.py
+++ b/pylib/gyp/generator/msvs.py
@@ -257,6 +257,8 @@ def _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset=False):
if not tools.get(tool_name):
tools[tool_name] = dict()
tool = tools[tool_name]
+ if 'CompileAsWinRT' == setting:
+ return
if tool.get(setting):
if only_if_unset: return
if type(tool[setting]) == list and type(value) == list:
@@ -286,6 +288,21 @@ def _ConfigFullName(config_name, config_data):
return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name)
+def _ConfigWindowsTargetPlatformVersion(config_data):
+ ver = config_data.get('msvs_windows_sdk_version')
+
+ for key in [r'HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s',
+ r'HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s']:
+ sdk_dir = MSVSVersion._RegistryGetValue(key % ver, 'InstallationFolder')
+ if not sdk_dir:
+ continue
+ version = MSVSVersion._RegistryGetValue(key % ver, 'ProductVersion') or ''
+ # Find a matching entry in sdk_dir\include.
+ names = sorted([x for x in os.listdir(r'%s\include' % sdk_dir) \
scottmg 2016/04/05 16:52:36 This \ is unnecessary.
munyirik 2016/04/11 20:07:10 Acknowledged.
+ if x.startswith(version)], reverse=True)
+ return names[0]
+
+
def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path,
quote_cmd, do_setup_env):
@@ -2676,6 +2693,21 @@ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name):
else:
properties[0].append(['ApplicationType', 'Windows Store'])
+ platform_name = None
+ msvs_windows_sdk_version = None
+ for configuration in spec['configurations'].itervalues():
+ platform_name = platform_name or _ConfigPlatform(configuration)
+ msvs_windows_sdk_version = (msvs_windows_sdk_version or
+ _ConfigWindowsTargetPlatformVersion(configuration))
+ if platform_name and msvs_windows_sdk_version:
+ break
+
+ if platform_name == 'ARM':
+ properties[0].append(['WindowsSDKDesktopARMSupport', 'true'])
+ if msvs_windows_sdk_version:
+ properties[0].append(['WindowsTargetPlatformVersion',
+ str(msvs_windows_sdk_version)])
+
return properties
def _GetMSBuildConfigurationDetails(spec, build_file):
@@ -3217,6 +3249,9 @@ def _GetMSBuildProjectReferences(project):
['ReferenceOutputAssembly', 'false']
]
for config in dependency.spec.get('configurations', {}).itervalues():
+ if config.get('msvs_use_library_dependency_inputs', 0):
scottmg 2016/04/05 16:52:36 Could you explain why this needs to be added?
munyirik 2016/04/11 20:07:10 Ah yeah, your earlier comment was right. This is n
+ project_ref.append(['UseLibraryDependencyInputs', 'true'])
+ break
# If it's disabled in any config, turn it off in the reference.
if config.get('msvs_2010_disable_uldi_when_referenced', 0):
project_ref.append(['UseLibraryDependencyInputs', 'false'])
« no previous file with comments | « pylib/gyp/MSVSSettings.py ('k') | test/lib/TestGyp.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698