From 6a0e6740432dfd22c54976ae3fe2fc1c9fea0b3d Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 3 Jul 2018 23:16:33 +0300 Subject: Add kwarg for specifying symbol visibility. --- mesonbuild/compilers/compilers.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mesonbuild/compilers/compilers.py') 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): -- cgit v1.1