diff options
| author | Martin Hostettler <textshell@uchuujin.de> | 2018-02-18 17:55:19 +0100 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-14 23:43:29 +0300 |
| commit | 3f7c6cf3d6a204e9665faad3c05bb5049f08ac74 (patch) | |
| tree | 70ac29c3483fe52c470033e6f593a7d9f2b29b07 /test cases/unit | |
| parent | 7c37ca15f38dce30eeef6cd8bc53f25406f9029e (diff) | |
| download | meson-3f7c6cf3d6a204e9665faad3c05bb5049f08ac74.tar.gz | |
Improve generation of pkg-config files for static only libraries.
Previously pkg-config files generated by the pkgconfig modules for static libraries
with dependencies could only be used in a dependencies with `static: true`.
This was caused by the dependencies only appearing in Libs.private even
if they are needed in the default linking mode. But a user of a
dependency should not have to know if the default linking mode is static
or dynamic; A dependency('somelib') call should always pull in all
needed pieces into the build.
Now for meson build static libraries passed via `libraries` to the generate
method automatically promote dependencies to public.
Diffstat (limited to 'test cases/unit')
5 files changed, 34 insertions, 0 deletions
diff --git a/test cases/unit/28 pkgconfig use libraries/app/app.c b/test cases/unit/28 pkgconfig use libraries/app/app.c new file mode 100644 index 000000000..b271a9e61 --- /dev/null +++ b/test cases/unit/28 pkgconfig use libraries/app/app.c @@ -0,0 +1,6 @@ +void libb_func(); + +int main() { + libb_func(); + return 0; +} diff --git a/test cases/unit/28 pkgconfig use libraries/app/meson.build b/test cases/unit/28 pkgconfig use libraries/app/meson.build new file mode 100644 index 000000000..3d85a32f4 --- /dev/null +++ b/test cases/unit/28 pkgconfig use libraries/app/meson.build @@ -0,0 +1,5 @@ +project('app', ['c']) + +b = dependency('test-b') + +executable('app', 'app.c', dependencies : [b]) diff --git a/test cases/unit/28 pkgconfig use libraries/lib/liba.c b/test cases/unit/28 pkgconfig use libraries/lib/liba.c new file mode 100644 index 000000000..e98906b9c --- /dev/null +++ b/test cases/unit/28 pkgconfig use libraries/lib/liba.c @@ -0,0 +1,2 @@ +void liba_func() { +} diff --git a/test cases/unit/28 pkgconfig use libraries/lib/libb.c b/test cases/unit/28 pkgconfig use libraries/lib/libb.c new file mode 100644 index 000000000..3160e5f52 --- /dev/null +++ b/test cases/unit/28 pkgconfig use libraries/lib/libb.c @@ -0,0 +1,5 @@ +void liba_func(); + +void libb_func() { + liba_func(); +} diff --git a/test cases/unit/28 pkgconfig use libraries/lib/meson.build b/test cases/unit/28 pkgconfig use libraries/lib/meson.build new file mode 100644 index 000000000..748adf47a --- /dev/null +++ b/test cases/unit/28 pkgconfig use libraries/lib/meson.build @@ -0,0 +1,16 @@ +project('lib', ['c']) + +a = library('test-a', 'liba.c', install: true) + +b = library('test-b', 'libb.c', link_with: a, install: true) + +import('pkgconfig').generate( + version: '0.0', + description: 'test library', + filebase: 'test-b', + name: 'test library', + libraries: [b], + subdirs: ['.'] +) + + |
