Skip to content

Commit

Permalink
Fixes .vcxproj for vs2017 vs2019
Browse files Browse the repository at this point in the history
fixes #6314

in case of backend is vs2017 or vs2019 place LanguageStandard tag with stdcpp version and LanguageStandard_C tag with stdc version in .vcxproj file
  • Loading branch information
Олег Мороз authored and jpakkane committed Nov 2, 2021
1 parent 038b31e commit 387e846
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mesonbuild/backend/vs2010backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,15 @@ def gen_vcxproj(self, target, ofname, guid):
else:
ET.SubElement(clconf, 'FavorSizeOrSpeed').text = 'Speed'
# Note: SuppressStartupBanner is /NOLOGO and is 'true' by default
if self.name in ('vs2017', 'vs2019'):
if 'cpp' in file_args:
optargs = [x for x in file_args['cpp'] if x.startswith('/std:c++')]
if optargs:
ET.SubElement(clconf, 'LanguageStandard').text = optargs[0].replace("/std:c++","stdcpp")
if 'c' in file_args:
optargs = [x for x in file_args['c'] if x.startswith('/std:c')]
if optargs:
ET.SubElement(clconf, 'LanguageStandard_C').text = optargs[0].replace("/std:c","stdc")
pch_sources = {}
if self.environment.coredata.options.get(OptionKey('b_pch')):
for lang in ['c', 'cpp']:
Expand Down

0 comments on commit 387e846

Please sign in to comment.