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

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

Issue 607553002: Added msvs_enable_winrt to enable creating Windows Store compatible projects for .dlls that are con… (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Added ARM to TargetMachine map for completeness Created 6 years, 3 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 | pylib/gyp/msvs_emulation.py » ('j') | pylib/gyp/msvs_emulation.py » ('J')
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 80e3104fd3772860e1d79b275199723ad6830dfe..517ce3c623ae0e9b695cdff0e717b0279627acd8 100644
--- a/pylib/gyp/generator/msvs.py
+++ b/pylib/gyp/generator/msvs.py
@@ -83,6 +83,9 @@ generator_additional_non_configuration_keys = [
'msvs_external_builder_build_cmd',
'msvs_external_builder_clean_cmd',
'msvs_external_builder_clcompile_cmd',
+ 'msvs_enable_winrt',
+ 'msvs_requires_importlibrary',
+ 'msvs_enable_winphone',
]
@@ -2595,15 +2598,26 @@ def _GetMSBuildProjectConfigurations(configurations):
def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name):
namespace = os.path.splitext(gyp_file_name)[0]
- return [
+ properties = [
['PropertyGroup', {'Label': 'Globals'},
- ['ProjectGuid', guid],
- ['Keyword', 'Win32Proj'],
- ['RootNamespace', namespace],
- ['IgnoreWarnCompileDuplicatedFilename', 'true'],
+ ['ProjectGuid', guid],
+ ['Keyword', 'Win32Proj'],
+ ['RootNamespace', namespace],
+ ['IgnoreWarnCompileDuplicatedFilename', 'true'],
]
- ]
+ ]
+
+ if spec.get('msvs_enable_winrt'):
+ properties[0].append(['DefaultLanguage', 'en-US'])
+ properties[0].append(['AppContainerApplication', 'true'])
+ properties[0].append(['ApplicationTypeRevision', '8.1'])
+
+ if spec.get('msvs_enable_winphone'):
+ properties[0].append(['ApplicationType', 'Windows Phone'])
+ else:
+ properties[0].append(['ApplicationType', 'Windows Store'])
+ return properties
def _GetMSBuildConfigurationDetails(spec, build_file):
properties = {}
@@ -2614,8 +2628,9 @@ def _GetMSBuildConfigurationDetails(spec, build_file):
_AddConditionalProperty(properties, condition, 'ConfigurationType',
msbuild_attributes['ConfigurationType'])
if character_set:
- _AddConditionalProperty(properties, condition, 'CharacterSet',
- character_set)
+ if 'msvs_enable_winrt' not in spec :
+ _AddConditionalProperty(properties, condition, 'CharacterSet',
+ character_set)
return _GetMSBuildPropertyGroup(spec, 'Configuration', properties)
@@ -2974,6 +2989,13 @@ def _FinalizeMSBuildSettings(spec, configuration):
'PrecompiledHeaderFile', precompiled_header)
_ToolAppend(msbuild_settings, 'ClCompile',
'ForcedIncludeFiles', [precompiled_header])
+ else:
+ _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'NotUsing')
+ # Turn off WinRT compilation
+ _ToolAppend(msbuild_settings, 'ClCompile', 'CompileAsWinRT', 'false')
+ # Turn on import libraries if appropriate
+ if spec.get('msvs_requires_importlibrary'):
+ _ToolAppend(msbuild_settings, '', 'IgnoreImportLibrary', 'false')
# Loadable modules don't generate import libraries;
# tell dependent projects to not expect one.
if spec['type'] == 'loadable_module':
@@ -3214,7 +3236,10 @@ 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)
- content += _GetMSBuildLocalProperties(project.msbuild_toolset)
+ if spec.get('msvs_enable_winphone'):
+ content += _GetMSBuildLocalProperties('v120_wp81')
+ else:
+ content += _GetMSBuildLocalProperties(project.msbuild_toolset)
content += import_cpp_props_section
content += _GetMSBuildExtensions(props_files_of_rules)
content += _GetMSBuildPropertySheets(configurations)
« no previous file with comments | « no previous file | pylib/gyp/msvs_emulation.py » ('j') | pylib/gyp/msvs_emulation.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698