aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-10-07 22:49:25 +0300
committerGitHub <noreply@github.com>2016-10-07 22:49:25 +0300
commit4781f471c227bee330eb459a35c908770cea64fb (patch)
treeb5a65f2beb5310fdd8117aaa26f1df3a3d0da436 /mesonbuild/compilers.py
parent7ecdf5913058873f0e71af7d9e68ec6804569773 (diff)
parent67c9e520de4194b06fcfa2609f2036dfd9636217 (diff)
downloadmeson-4781f471c227bee330eb459a35c908770cea64fb.zip
meson-4781f471c227bee330eb459a35c908770cea64fb.tar.gz
meson-4781f471c227bee330eb459a35c908770cea64fb.tar.bz2
Merge pull request #856 from centricular/static_library_pic
Add cross-platform PIC support for static libraries
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 19fb888..c81a599 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1934,8 +1934,8 @@ class GnuCompiler:
return defines[define]
def get_pic_args(self):
- if self.gcc_type == GCC_MINGW:
- return [] # On Window gcc defaults to fpic being always on.
+ if self.gcc_type in (GCC_MINGW, GCC_OSX):
+ return [] # On Window and OS X, pic is always on.
return ['-fPIC']
def get_buildtype_args(self, buildtype):
@@ -2059,6 +2059,11 @@ class ClangCompiler():
self.base_options.append('b_lundef')
self.base_options.append('b_asneeded')
+ def get_pic_args(self):
+ if self.clang_type in (CLANG_WIN, CLANG_OSX):
+ return [] # On Window and OS X, pic is always on.
+ return ['-fPIC']
+
def get_buildtype_args(self, buildtype):
return gnulike_buildtype_args[buildtype]
@@ -2174,8 +2179,8 @@ class FortranCompiler(Compiler):
return ' '.join(self.exelist)
def get_pic_args(self):
- if self.gcc_type == GCC_MINGW:
- return [] # On Windows gcc defaults to fpic being always on.
+ if self.gcc_type in (GCC_MINGW, GCC_OSX):
+ return [] # On Window and OS X, pic is always on.
return ['-fPIC']
def get_std_shared_lib_link_args(self):