Skip to content

Commit a20faed

Browse files
committed
gyp: enable MARMASM items only on new VS versions
PR-URL: #1762 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 0efb8fb commit a20faed

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

gyp/pylib/gyp/generator/msvs.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def _import_OrderedDict():
8888
'msvs_enable_winrt',
8989
'msvs_requires_importlibrary',
9090
'msvs_enable_winphone',
91+
'msvs_enable_marmasm',
9192
'msvs_application_type_revision',
9293
'msvs_target_platform_version',
9394
'msvs_target_platform_minversion',
@@ -3362,7 +3363,8 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):
33623363
content += _GetMSBuildLocalProperties(project.msbuild_toolset)
33633364
content += import_cpp_props_section
33643365
content += import_masm_props_section
3365-
content += import_marmasm_props_section
3366+
if spec.get('msvs_enable_marmasm'):
3367+
content += import_marmasm_props_section
33663368
content += _GetMSBuildExtensions(props_files_of_rules)
33673369
content += _GetMSBuildPropertySheets(configurations)
33683370
content += macro_section
@@ -3375,7 +3377,8 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):
33753377
content += _GetMSBuildProjectReferences(project)
33763378
content += import_cpp_targets_section
33773379
content += import_masm_targets_section
3378-
content += import_marmasm_targets_section
3380+
if spec.get('msvs_enable_marmasm'):
3381+
content += import_marmasm_targets_section
33793382
content += _GetMSBuildExtensionTargets(targets_files_of_rules)
33803383

33813384
if spec.get('msvs_external_builder'):

lib/configure.js

+9
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ function configure (gyp, argv, callback) {
146146
if (vsInfo.sdk) {
147147
defaults['msvs_windows_target_platform_version'] = vsInfo.sdk
148148
}
149+
if (variables.target_arch == 'arm64') {
150+
if (vsInfo.versionMajor > 15 ||
151+
(vsInfo.versionMajor === 15 && vsInfo.versionMajor >= 9)) {
152+
defaults['msvs_enable_marmasm'] = 1
153+
} else {
154+
log.warn('Compiling ARM64 assembly is only available in\n' +
155+
'Visual Studio 2017 version 15.9 and above')
156+
}
157+
}
149158
variables['msbuild_path'] = vsInfo.msBuild
150159
}
151160

0 commit comments

Comments
 (0)