Skip to content

Commit

Permalink
gyp: enable MARMASM items only on new VS versions
Browse files Browse the repository at this point in the history
PR-URL: #1762
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
joaocgreis committed Jun 4, 2019
1 parent 0efb8fb commit a20faed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gyp/pylib/gyp/generator/msvs.py
Expand Up @@ -88,6 +88,7 @@ def _import_OrderedDict():
'msvs_enable_winrt',
'msvs_requires_importlibrary',
'msvs_enable_winphone',
'msvs_enable_marmasm',
'msvs_application_type_revision',
'msvs_target_platform_version',
'msvs_target_platform_minversion',
Expand Down Expand Up @@ -3362,7 +3363,8 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):
content += _GetMSBuildLocalProperties(project.msbuild_toolset)
content += import_cpp_props_section
content += import_masm_props_section
content += import_marmasm_props_section
if spec.get('msvs_enable_marmasm'):
content += import_marmasm_props_section
content += _GetMSBuildExtensions(props_files_of_rules)
content += _GetMSBuildPropertySheets(configurations)
content += macro_section
Expand All @@ -3375,7 +3377,8 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):
content += _GetMSBuildProjectReferences(project)
content += import_cpp_targets_section
content += import_masm_targets_section
content += import_marmasm_targets_section
if spec.get('msvs_enable_marmasm'):
content += import_marmasm_targets_section
content += _GetMSBuildExtensionTargets(targets_files_of_rules)

if spec.get('msvs_external_builder'):
Expand Down
9 changes: 9 additions & 0 deletions lib/configure.js
Expand Up @@ -146,6 +146,15 @@ function configure (gyp, argv, callback) {
if (vsInfo.sdk) {
defaults['msvs_windows_target_platform_version'] = vsInfo.sdk
}
if (variables.target_arch == 'arm64') {
if (vsInfo.versionMajor > 15 ||
(vsInfo.versionMajor === 15 && vsInfo.versionMajor >= 9)) {
defaults['msvs_enable_marmasm'] = 1
} else {
log.warn('Compiling ARM64 assembly is only available in\n' +
'Visual Studio 2017 version 15.9 and above')
}
}
variables['msbuild_path'] = vsInfo.msBuild
}

Expand Down

0 comments on commit a20faed

Please sign in to comment.