diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-10-30 22:49:17 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-10-30 22:49:17 +0200 |
commit | ff74258389ed75e11dc58b34a0d384f62b07822e (patch) | |
tree | 1b3eff240e77840857fcc96e3c910fb5f4eb8f80 /mesonbuild/compilers | |
parent | aca3bff4fe4ecdf585d123f181987bc0696a7b31 (diff) | |
download | meson-cppnoexcept.tar.gz |
Add option for controlling RTTI.cppnoexcept
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/cpp.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 6161b7af9..3f395cdea 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -167,6 +167,7 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler): opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', ['none', 'default', 'a', 's', 'sc'], 'default'), + 'cpp_rtti': coredata.UserComboOption('Enable RTTI', True), 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'], @@ -181,6 +182,9 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler): non_msvc_eh_options(options['cpp_eh'].value, args) + if not options['cpp_rtti'].value: + args.append('-fno-rtti') + return args def get_option_link_args(self, options): @@ -265,6 +269,7 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', ['none', 'default', 'a', 's', 'sc'], 'default'), + 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True), 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'], @@ -285,6 +290,9 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): non_msvc_eh_options(options['cpp_eh'].value, args) + if not options['cpp_rtti'].value: + args.append('-fno-rtti') + if options['cpp_debugstl'].value: args.append('-D_GLIBCXX_DEBUG=1') return args @@ -373,6 +381,7 @@ class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler): opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', ['none', 'default', 'a', 's', 'sc'], 'default'), + 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True), 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none'] + c_stds + g_stds, 'none'), @@ -391,6 +400,8 @@ class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler): args.append('-std=' + remap_cpp03.get(std.value, std.value)) if options['cpp_eh'].value == 'none': args.append('-fno-exceptions') + if not options['cpp_rtti'].value: + args.append('-fno-rtti') if options['cpp_debugstl'].value: args.append('-D_GLIBCXX_DEBUG=1') return args @@ -422,6 +433,7 @@ class VisualStudioLikeCPPCompilerMixin: opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', ['none', 'default', 'a', 's', 'sc'], 'default'), + 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True), 'cpp_std': coredata.UserComboOption('C++ language standard to use', cpp_stds, 'none'), @@ -440,6 +452,9 @@ class VisualStudioLikeCPPCompilerMixin: else: args.append('/EH' + eh.value) + if not options['cpp_rtti'].value: + args.append('/GR-') + permissive, ver = self.VC_VERSION_MAP[options['cpp_std'].value] if ver is not None: |