Skip to content

Commit

Permalink
feat(msvs): add SpectreMitigation attribute (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhao271 authored Mar 30, 2023
1 parent 2f79158 commit 853e464
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pylib/gyp/easy_xml_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
"<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"</PropertyGroup>"
"</Project>"
)
Expand All @@ -99,6 +100,7 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
["SpectreMitigation", "SpectreLoadCF"]
],
]
)
Expand Down
6 changes: 6 additions & 0 deletions pylib/gyp/generator/msvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3006,6 +3006,10 @@ def _GetMSBuildConfigurationDetails(spec, build_file):
character_set = msbuild_attributes.get("CharacterSet")
config_type = msbuild_attributes.get("ConfigurationType")
_AddConditionalProperty(properties, condition, "ConfigurationType", config_type)
spectre_mitigation = msbuild_attributes.get('SpectreMitigation')
if spectre_mitigation:
_AddConditionalProperty(properties, condition, "SpectreMitigation",
spectre_mitigation)
if config_type == "Driver":
_AddConditionalProperty(properties, condition, "DriverType", "WDM")
_AddConditionalProperty(
Expand Down Expand Up @@ -3094,6 +3098,8 @@ def _ConvertMSVSBuildAttributes(spec, config, build_file):
msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a])
elif a == "ConfigurationType":
msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a])
elif a == "SpectreMitigation":
msbuild_attributes[a] = msvs_attributes[a]
else:
print("Warning: Do not know how to convert MSVS attribute " + a)
return msbuild_attributes
Expand Down

0 comments on commit 853e464

Please sign in to comment.