diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-05 15:58:45 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-08 01:02:13 +0530 |
commit | ee8b3b12a067c52efcfb7c05c638023fbe0495c8 (patch) | |
tree | 85deebaf86566e3ba393611c194af70a5188189d /mesonbuild/backend/backends.py | |
parent | 71eddecdc7e82b16c5e454137d641f2a5f7c9c94 (diff) | |
download | meson-ee8b3b12a067c52efcfb7c05c638023fbe0495c8.zip meson-ee8b3b12a067c52efcfb7c05c638023fbe0495c8.tar.gz meson-ee8b3b12a067c52efcfb7c05c638023fbe0495c8.tar.bz2 |
Add cross-platform PIC support for static libraries
With C/C++, on Windows you don't need to pass any arguments for a static
library to be PIC. On UNIX platforms you need to pass -fPIC.
Other languages such as D have compiler-specific PIC arguments required
for PIC support in static libraries on UNIX platforms.
This kwarg allows people to specify which static libraries should be
built with PIC support. This is usually used for static libraries that
will be linked into shared libraries.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index d5af056..16f7ada 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -341,6 +341,8 @@ class Backend(): commands += compiler.get_werror_args() if isinstance(target, build.SharedLibrary): commands += compiler.get_pic_args() + if isinstance(target, build.StaticLibrary) and target.pic: + commands += compiler.get_pic_args() for dep in target.get_external_deps(): # Cflags required by external deps might have UNIX-specific flags, # so filter them out if needed |