aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-04-04 22:47:59 +0300
committerGitHub <noreply@github.com>2018-04-04 22:47:59 +0300
commitaef1a81b3586aeb48988b60fbeaef5c19e112c45 (patch)
tree23abfa769e8b948a1d94afaa1bdc8ddcaa369429 /mesonbuild/modules
parentc1fcc8ab3e1cac0823f3527000e543cc96885d48 (diff)
parent68f9846b7c584815d821c60fcdff866fe629955a (diff)
downloadmeson-aef1a81b3586aeb48988b60fbeaef5c19e112c45.zip
meson-aef1a81b3586aeb48988b60fbeaef5c19e112c45.tar.gz
meson-aef1a81b3586aeb48988b60fbeaef5c19e112c45.tar.bz2
Merge pull request #2711 from xclaesse/both-library
Add both_library() to build both shared and static library
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/pkgconfig.py22
-rw-r--r--mesonbuild/modules/python3.py7
2 files changed, 12 insertions, 17 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index ef74d63..c587f84 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -105,26 +105,24 @@ class DependenciesHelper:
if obj.found():
processed_libs += obj.get_link_args()
processed_cflags += obj.get_compile_args()
- elif isinstance(obj, build.SharedLibrary):
+ elif isinstance(obj, build.SharedLibrary) and obj.shared_library_only:
+ # Do not pull dependencies for shared libraries because they are
+ # only required for static linking. Adding private requires has
+ # the side effect of exposing their cflags, which is the
+ # intended behaviour of pkg-config but force Debian to add more
+ # than needed build deps.
+ # See https://bugs.freedesktop.org/show_bug.cgi?id=105572
processed_libs.append(obj)
if public:
if not hasattr(obj, 'generated_pc'):
obj.generated_pc = self.name
- elif isinstance(obj, build.StaticLibrary):
- # Due to a "feature" in pkgconfig, it leaks out private dependencies.
- # Thus we will not add them to the pc file unless the target
- # we are processing is a static library.
- #
- # This way (hopefully) "pkgconfig --libs --static foobar" works
- # and "pkgconfig --cflags/--libs foobar" does not have any trace
- # of dependencies that the build file creator has not explicitly
- # added to the dependency list.
+ elif isinstance(obj, (build.SharedLibrary, build.StaticLibrary)):
processed_libs.append(obj)
+ self.add_priv_libs(obj.get_dependencies())
+ self.add_priv_libs(obj.get_external_deps())
if public:
if not hasattr(obj, 'generated_pc'):
obj.generated_pc = self.name
- self.add_priv_libs(obj.get_dependencies())
- self.add_priv_libs(obj.get_external_deps())
elif isinstance(obj, str):
processed_libs.append(obj)
else:
diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py
index 9fd9f80..d2bf1dc 100644
--- a/mesonbuild/modules/python3.py
+++ b/mesonbuild/modules/python3.py
@@ -19,10 +19,7 @@ from . import ExtensionModule
from mesonbuild.modules import ModuleReturnValue
from . import permittedSnippetKwargs
from ..interpreterbase import noKwargs
-from ..interpreter import shlib_kwargs
-
-mod_kwargs = set()
-mod_kwargs.update(shlib_kwargs)
+from ..build import known_shmod_kwargs
class Python3Module(ExtensionModule):
@@ -30,7 +27,7 @@ class Python3Module(ExtensionModule):
super().__init__()
self.snippets.add('extension_module')
- @permittedSnippetKwargs(mod_kwargs)
+ @permittedSnippetKwargs(known_shmod_kwargs)
def extension_module(self, interpreter, state, args, kwargs):
if 'name_prefix' in kwargs:
raise mesonlib.MesonException('Name_prefix is set automatically, specifying it is forbidden.')