diff --git a/src/pygccxml/parser/source_reader.py b/src/pygccxml/parser/source_reader.py index f2d1cb9e..f64ae4e1 100644 --- a/src/pygccxml/parser/source_reader.py +++ b/src/pygccxml/parser/source_reader.py @@ -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") @@ -135,6 +136,8 @@ 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 ') @@ -142,7 +145,7 @@ def __create_command_line_castxml(self, source_file, xmlfile): 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: