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 From fb2cdd0fe2797b30e1fd4c118407302402739a3b Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 9 Aug 2018 19:46:45 +0300 Subject: Call it gnu_symbol_visibility instead. --- mesonbuild/compilers/compilers.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'mesonbuild/compilers/compilers.py') diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 3668a79..b62bc4a 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -311,13 +311,13 @@ 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'], - } +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': @@ -1070,7 +1070,7 @@ class Compiler: # building fails with undefined symbols. return [] - def symbol_visibility_args(self, vistype): + def gnu_symbol_visibility_args(self, vistype): return [] GCC_STANDARD = 0 @@ -1288,8 +1288,8 @@ class GnuCompiler: def openmp_flags(self): return ['-fopenmp'] - def symbol_visibility_args(self, vistype): - return common_symbol_visibility_args[vistype] + 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 @@ -1432,8 +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] + def gnu_symbol_visibility_args(self, vistype): + return gnu_symbol_visibility_args[vistype] class ArmclangCompiler: def __init__(self): -- cgit v1.1