aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-08-11 19:59:34 +0300
committerGitHub <noreply@github.com>2018-08-11 19:59:34 +0300
commitf91b463bf4625bfc167b78b52f091f45cddfdff4 (patch)
tree13747f96c8f68d8b6bb1b4a442de755a6cdb8ae4 /mesonbuild/compilers
parentf80c11e7ee4f521b1b4e3af56293fdcac15676fe (diff)
parentfb2cdd0fe2797b30e1fd4c118407302402739a3b (diff)
downloadmeson-f91b463bf4625bfc167b78b52f091f45cddfdff4.zip
meson-f91b463bf4625bfc167b78b52f091f45cddfdff4.tar.gz
meson-f91b463bf4625bfc167b78b52f091f45cddfdff4.tar.bz2
Merge pull request #3831 from mesonbuild/symvisibility
Add gnu_symbol_visibility keyword argument
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/compilers.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index cb3ed23..ea0fc2c 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -311,6 +311,14 @@ vs64_instruction_set_args = {'mmx': ['/arch:AVX'],
'neon': None,
}
+gnu_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 []
@@ -1065,6 +1073,9 @@ class Compiler:
# building fails with undefined symbols.
return []
+ def gnu_symbol_visibility_args(self, vistype):
+ return []
+
GCC_STANDARD = 0
GCC_OSX = 1
GCC_MINGW = 2
@@ -1280,6 +1291,8 @@ class GnuCompiler:
def openmp_flags(self):
return ['-fopenmp']
+ def gnu_symbol_visibility_args(self, vistype):
+ return gnu_symbol_visibility_args[vistype]
class ElbrusCompiler(GnuCompiler):
# Elbrus compiler is nearly like GCC, but does not support
@@ -1422,6 +1435,8 @@ class ClangCompiler:
# Shouldn't work, but it'll be checked explicitly in the OpenMP dependency.
return []
+ def gnu_symbol_visibility_args(self, vistype):
+ return gnu_symbol_visibility_args[vistype]
class ArmclangCompiler:
def __init__(self):