build,win: teach GYP MSVS generator about MARMASM · nodejs/node@06c10cd (original) (raw)

`@@ -2076,7 +2076,8 @@ def GenerateOutput(target_list, target_dicts, data, params):

`

2076

2076

``

2077

2077

``

2078

2078

`def _GenerateMSBuildFiltersFile(filters_path, source_files,

`

2079

``

`-

rule_dependencies, extension_to_rule_name):

`

``

2079

`+

rule_dependencies, extension_to_rule_name,

`

``

2080

`+

platforms):

`

2080

2081

`"""Generate the filters file.

`

2081

2082

``

2082

2083

` This file is used by Visual Studio to organize the presentation of source

`

`@@ -2090,7 +2091,8 @@ def _GenerateMSBuildFiltersFile(filters_path, source_files,

`

2090

2091

`filter_group = []

`

2091

2092

`source_group = []

`

2092

2093

`_AppendFiltersForMSBuild('', source_files, rule_dependencies,

`

2093

``

`-

extension_to_rule_name, filter_group, source_group)

`

``

2094

`+

extension_to_rule_name, platforms,

`

``

2095

`+

filter_group, source_group)

`

2094

2096

`if filter_group:

`

2095

2097

`content = ['Project',

`

2096

2098

` {'ToolsVersion': '4.0',

`

`@@ -2106,7 +2108,7 @@ def _GenerateMSBuildFiltersFile(filters_path, source_files,

`

2106

2108

``

2107

2109

``

2108

2110

`def _AppendFiltersForMSBuild(parent_filter_name, sources, rule_dependencies,

`

2109

``

`-

extension_to_rule_name,

`

``

2111

`+

extension_to_rule_name, platforms,

`

2110

2112

`filter_group, source_group):

`

2111

2113

`"""Creates the list of filters and sources to be added in the filter file.

`

2112

2114

``

`@@ -2132,11 +2134,12 @@ def _AppendFiltersForMSBuild(parent_filter_name, sources, rule_dependencies,

`

2132

2134

`# Recurse and add its dependents.

`

2133

2135

`_AppendFiltersForMSBuild(filter_name, source.contents,

`

2134

2136

`rule_dependencies, extension_to_rule_name,

`

2135

``

`-

filter_group, source_group)

`

``

2137

`+

platforms, filter_group, source_group)

`

2136

2138

`else:

`

2137

2139

`# It's a source. Create a source entry.

`

2138

2140

`_, element = _MapFileToMsBuildSourceType(source, rule_dependencies,

`

2139

``

`-

extension_to_rule_name)

`

``

2141

`+

extension_to_rule_name,

`

``

2142

`+

platforms)

`

2140

2143

`source_entry = [element, {'Include': source}]

`

2141

2144

`# Specify the filter it is part of, if any.

`

2142

2145

`if parent_filter_name:

`

`@@ -2145,7 +2148,7 @@ def _AppendFiltersForMSBuild(parent_filter_name, sources, rule_dependencies,

`

2145

2148

``

2146

2149

``

2147

2150

`def _MapFileToMsBuildSourceType(source, rule_dependencies,

`

2148

``

`-

extension_to_rule_name):

`

``

2151

`+

extension_to_rule_name, platforms):

`

2149

2152

`"""Returns the group and element type of the source file.

`

2150

2153

``

2151

2154

` Arguments:

`

`@@ -2172,6 +2175,9 @@ def _MapFileToMsBuildSourceType(source, rule_dependencies,

`

2172

2175

`elif ext in ['.s', '.asm']:

`

2173

2176

`group = 'masm'

`

2174

2177

`element = 'MASM'

`

``

2178

`+

for platform in platforms:

`

``

2179

`+

if platform.lower() in ['arm', 'arm64']:

`

``

2180

`+

element = 'MARMASM'

`

2175

2181

`elif ext == '.idl':

`

2176

2182

`group = 'midl'

`

2177

2183

`element = 'Midl'

`

`@@ -3275,7 +3281,8 @@ def _AddSources2(spec, sources, exclusions, grouped_sources,

`

3275

3281

`detail.append(['ForcedIncludeFiles', ''])

`

3276

3282

``

3277

3283

`group, element = _MapFileToMsBuildSourceType(source, rule_dependencies,

`

3278

``

`-

extension_to_rule_name)

`

``

3284

`+

extension_to_rule_name,

`

``

3285

`+

_GetUniquePlatforms(spec))

`

3279

3286

`grouped_sources[group].append([element, {'Include': source}] + detail)

`

3280

3287

``

3281

3288

``

`@@ -3358,7 +3365,7 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):

`

3358

3365

``

3359

3366

`_GenerateMSBuildFiltersFile(project.path + '.filters', sources,

`

3360

3367

`rule_dependencies,

`

3361

``

`-

extension_to_rule_name)

`

``

3368

`+

extension_to_rule_name, _GetUniquePlatforms(spec))

`

3362

3369

`missing_sources = _VerifySourcesExist(sources, project_dir)

`

3363

3370

``

3364

3371

`for configuration in configurations.itervalues():

`

`@@ -3378,6 +3385,12 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):

`

3378

3385

`import_masm_targets_section = [

`

3379

3386

` ['Import',

`

3380

3387

` {'Project': r'$(VCTargetsPath)\BuildCustomizations\masm.targets'}]]

`

``

3388

`+

import_marmasm_props_section = [

`

``

3389

`+

['Import',

`

``

3390

`+

{'Project': r'$(VCTargetsPath)\BuildCustomizations\marmasm.props'}]]

`

``

3391

`+

import_marmasm_targets_section = [

`

``

3392

`+

['Import',

`

``

3393

`+

{'Project': r'$(VCTargetsPath)\BuildCustomizations\marmasm.targets'}]]

`

3381

3394

`macro_section = [['PropertyGroup', {'Label': 'UserMacros'}]]

`

3382

3395

``

3383

3396

`content = [

`

`@@ -3398,6 +3411,7 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):

`

3398

3411

`content += _GetMSBuildLocalProperties(project.msbuild_toolset)

`

3399

3412

`content += import_cpp_props_section

`

3400

3413

`content += import_masm_props_section

`

``

3414

`+

content += import_marmasm_props_section

`

3401

3415

`content += _GetMSBuildExtensions(props_files_of_rules)

`

3402

3416

`content += _GetMSBuildPropertySheets(configurations)

`

3403

3417

`content += macro_section

`

`@@ -3410,6 +3424,7 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):

`

3410

3424

`content += _GetMSBuildProjectReferences(project)

`

3411

3425

`content += import_cpp_targets_section

`

3412

3426

`content += import_masm_targets_section

`

``

3427

`+

content += import_marmasm_targets_section

`

3413

3428

`content += _GetMSBuildExtensionTargets(targets_files_of_rules)

`

3414

3429

``

3415

3430

`if spec.get('msvs_external_builder'):

`