diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-10-10 20:19:22 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-10-10 21:28:28 +0300 |
commit | 28df8b800e6b4a36e97bfb3db8e6f84b262b1ce7 (patch) | |
tree | e5c02eb07a399c73ec5fc727590e01aceedb56aa /mesonbuild/compilers.py | |
parent | e2b3752f875754abcc3981754505ae0db9e18155 (diff) | |
download | meson-28df8b800e6b4a36e97bfb3db8e6f84b262b1ce7.zip meson-28df8b800e6b4a36e97bfb3db8e6f84b262b1ce7.tar.gz meson-28df8b800e6b4a36e97bfb3db8e6f84b262b1ce7.tar.bz2 |
Add an option to select if static libraries are built with -fPIC.
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r-- | mesonbuild/compilers.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 3cf761a..bb733a7 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -190,7 +190,10 @@ base_options = { 'always'), 'b_ndebug' : coredata.UserBooleanOption('b_ndebug', 'Disable asserts', - False) + False), + 'b_staticpic' : coredata.UserBooleanOption('b_staticpic', + 'Build static libraries as position independent', + True), } def sanitizer_compile_args(value): @@ -1521,7 +1524,7 @@ class GnuDCompiler(DCompiler): self.warn_args = {'1': ['-Wall', '-Wdeprecated'], '2': ['-Wall', '-Wextra', '-Wdeprecated'], '3': ['-Wall', '-Wextra', '-Wdeprecated', '-Wpedantic']} - self.base_options = ['b_colorout', 'b_sanitize'] + self.base_options = ['b_colorout', 'b_sanitize', 'b_staticpic'] def get_colorout_args(self, colortype): if mesonlib.version_compare(self.version, '>=4.9.0'): @@ -1909,7 +1912,7 @@ class GnuCompiler: self.gcc_type = gcc_type self.defines = defines or {} self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage', - 'b_colorout', 'b_ndebug'] + 'b_colorout', 'b_ndebug', 'b_staticpic'] if self.gcc_type != GCC_OSX: self.base_options.append('b_lundef') self.base_options.append('b_asneeded') @@ -2055,7 +2058,7 @@ class ClangCompiler(): self.id = 'clang' self.clang_type = clang_type self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage', - 'b_ndebug'] + 'b_ndebug', 'b_staticpic'] if self.clang_type != CLANG_OSX: self.base_options.append('b_lundef') self.base_options.append('b_asneeded') @@ -2285,7 +2288,7 @@ class GnuFortranCompiler(FortranCompiler): def get_define(self, define): if define in self.defines: - return defines[define] + return self.defines[define] def get_always_args(self): return ['-pipe'] |