diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-07-03 23:16:33 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-08-09 19:46:49 +0300 |
commit | 6a0e6740432dfd22c54976ae3fe2fc1c9fea0b3d (patch) | |
tree | 6e858ee5ae062f23737806bd44215b941a150673 /mesonbuild/compilers/compilers.py | |
parent | 15fb2843955b53414cf292cf0a6b7faf7ffc883a (diff) | |
download | meson-6a0e6740432dfd22c54976ae3fe2fc1c9fea0b3d.zip meson-6a0e6740432dfd22c54976ae3fe2fc1c9fea0b3d.tar.gz meson-6a0e6740432dfd22c54976ae3fe2fc1c9fea0b3d.tar.bz2 |
Add kwarg for specifying symbol visibility.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 25835a3..3668a79 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -311,6 +311,14 @@ vs64_instruction_set_args = {'mmx': ['/arch:AVX'], 'neon': None, } +common_symbol_visibility_args = {'': [], + 'default': ['-fvisibility=default'], + 'internal': ['-fvisibility=internal'], + 'hidden': ['-fvisibility=hidden'], + 'protected': ['-fvisibility=protected'], + 'inlineshidden': ['-fvisibility=hidden', '-fvisibility-inlines-hidden'], + } + def sanitizer_compile_args(value): if value == 'none': return [] @@ -1062,6 +1070,9 @@ class Compiler: # building fails with undefined symbols. return [] + def symbol_visibility_args(self, vistype): + return [] + GCC_STANDARD = 0 GCC_OSX = 1 GCC_MINGW = 2 @@ -1277,6 +1288,8 @@ class GnuCompiler: def openmp_flags(self): return ['-fopenmp'] + def symbol_visibility_args(self, vistype): + return common_symbol_visibility_args[vistype] class ElbrusCompiler(GnuCompiler): # Elbrus compiler is nearly like GCC, but does not support @@ -1419,6 +1432,8 @@ class ClangCompiler: # Shouldn't work, but it'll be checked explicitly in the OpenMP dependency. return [] + def symbol_visibility_args(self, vistype): + return common_symbol_visibility_args[vistype] class ArmclangCompiler: def __init__(self): |