Skip to content

Commit

Permalink
source_reader: transform std=c++XX -> std:c++XX when using mscv
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristosT committed Apr 16, 2024
1 parent 67bdfec commit 8186300
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pygccxml/parser/source_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def __create_command_line_castxml(self, source_file, xmlfile):
"your xml_generator_configuration_t(), or add it to your " +
"pygccxml configuration file."))

stdcxx_switch = self.__cxx_std.stdcxx
# Platform specific options
if platform.system() == 'Windows':
compilers = ("mingw", "g++", "gcc")
Expand All @@ -135,14 +136,16 @@ def __create_command_line_castxml(self, source_file, xmlfile):
if self.__config.compiler == 'msvc9':
cmd.append('"-D_HAS_TR1=0"')
cmd.append('--castxml-cc-msvc ')
# msvc uses std:c++XX format instead of std=c++XX
stdcxx_switch = stdcxx_switch.replace('=', ':')
else:
# On mac or linux, use gcc or clang (the flag is the same)
cmd.append('--castxml-cc-gnu ')

if self.__cxx_std.is_implicit:
std_flag = ''
else:
std_flag = ' ' + self.__cxx_std.stdcxx + ' '
std_flag = ' ' + stdcxx_switch + ' '

ccflags = self.__config.ccflags
if std_flag:
Expand Down

0 comments on commit 8186300

Please sign in to comment.