diff options
author | Moroz Oleg <o.moroz@1440.space> | 2021-10-18 13:48:49 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-11-02 18:50:44 +0200 |
commit | b72624171bf973ddb32b0792151a3b3e368e1770 (patch) | |
tree | 4e9c64258ae1a92423abc783f36111f7b97ac5ec /mesonbuild | |
parent | 387e84656845cfcc3c966f6cf754de65d601eccd (diff) | |
download | meson-b72624171bf973ddb32b0792151a3b3e368e1770.zip meson-b72624171bf973ddb32b0792151a3b3e368e1770.tar.gz meson-b72624171bf973ddb32b0792151a3b3e368e1770.tar.bz2 |
Move language standard in separate method within vsbackend
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 13 | ||||
-rw-r--r-- | mesonbuild/backend/vs2017backend.py | 10 | ||||
-rw-r--r-- | mesonbuild/backend/vs2019backend.py | 10 |
3 files changed, 24 insertions, 9 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index afc2713..8ec8087 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -1119,15 +1119,7 @@ class Vs2010Backend(backends.Backend): 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") + self.generate_lang_standard_info(file_args, clconf) pch_sources = {} if self.environment.coredata.options.get(OptionKey('b_pch')): for lang in ['c', 'cpp']: @@ -1515,3 +1507,6 @@ if %%errorlevel%% neq 0 goto :VCEnd''' def add_regen_dependency(self, root): regen_vcxproj = os.path.join(self.environment.get_build_dir(), 'REGEN.vcxproj') self.add_project_reference(root, regen_vcxproj, self.environment.coredata.regen_guid) + + def generate_lang_standard_info(self, file_args, clconf): + pass
\ No newline at end of file diff --git a/mesonbuild/backend/vs2017backend.py b/mesonbuild/backend/vs2017backend.py index fa21606..452d7a6 100644 --- a/mesonbuild/backend/vs2017backend.py +++ b/mesonbuild/backend/vs2017backend.py @@ -50,3 +50,13 @@ class Vs2017Backend(Vs2010Backend): def generate_debug_information(self, link): # valid values for vs2017 is 'false', 'true', 'DebugFastLink', 'DebugFull' ET.SubElement(link, 'GenerateDebugInformation').text = 'DebugFull' + + def generate_lang_standard_info(self, file_args, clconf): + 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")
\ No newline at end of file diff --git a/mesonbuild/backend/vs2019backend.py b/mesonbuild/backend/vs2019backend.py index 8f304e4..a87fa8a 100644 --- a/mesonbuild/backend/vs2019backend.py +++ b/mesonbuild/backend/vs2019backend.py @@ -45,3 +45,13 @@ class Vs2019Backend(Vs2010Backend): def generate_debug_information(self, link): # valid values for vs2019 is 'false', 'true', 'DebugFastLink', 'DebugFull' ET.SubElement(link, 'GenerateDebugInformation').text = 'DebugFull' + + def generate_lang_standard_info(self, file_args, clconf): + 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") |