aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-02-11 14:48:30 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-02-15 16:50:41 -0500
commit6240920c213fb76b4e4be8b6b59ae3346cbbcf77 (patch)
tree33ea225046c625f5942cf1972df9e52a17992482 /test cases
parent2d56ff135e6e0f3cdf455797a6561796a8c1b7b4 (diff)
downloadmeson-6240920c213fb76b4e4be8b6b59ae3346cbbcf77.zip
meson-6240920c213fb76b4e4be8b6b59ae3346cbbcf77.tar.gz
meson-6240920c213fb76b4e4be8b6b59ae3346cbbcf77.tar.bz2
pkgconfig module: allow custom variables to reference builtin directories
Automatically generate additional variables and write them into the generated pkg-config file. This means projects no longer need to manually define the ones they use, which is annoying for dataonly usages (it used to forbid setting the base library-relevant "reserved" ones, and now allows it only for dataonly. But it's bloat to manualy list them anyway). It also fixes a regression in commit 248e6cf4736ef9ec636228da66c28f9be03aa74f which caused libdir to not be set, and to be unsettable, if the pkg-config file has no libraries but uses the ${libdir} expansion in a custom variable. This could be considered likely a case for dataonly, but it's not guaranteed.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/44 pkgconfig-gen/meson.build16
-rw-r--r--test cases/common/44 pkgconfig-gen/test.json15
2 files changed, 30 insertions, 1 deletions
diff --git a/test cases/common/44 pkgconfig-gen/meson.build b/test cases/common/44 pkgconfig-gen/meson.build
index 128205a..a24c239 100644
--- a/test cases/common/44 pkgconfig-gen/meson.build
+++ b/test cases/common/44 pkgconfig-gen/meson.build
@@ -1,4 +1,4 @@
-project('pkgconfig-gen', 'c')
+project('pkgconfig-gen', 'c', meson_version: '>=0.60.0')
# Some CI runners does not have zlib, just skip them as we need some common
# external dependency.
@@ -149,3 +149,17 @@ ct = custom_target('stat3',
)
simple6 = library('simple6', link_with: ct)
pkgg.generate(simple6)
+
+# implicit variables
+pkgg.generate(
+ name : 'libvartest',
+ description : 'Check that implicit vars are created',
+ version : libver,
+ variables: ['datadir=${prefix}/data', 'foo=${datadir}/foo', 'bar=${bindir}/bar']
+)
+pkgg.generate(
+ name : 'libvartest2',
+ description : 'Check that libdir is not an implicit var',
+ version : libver,
+ variables: ['bar=${libdir}/bar']
+)
diff --git a/test cases/common/44 pkgconfig-gen/test.json b/test cases/common/44 pkgconfig-gen/test.json
index c7bdd43..118fecd 100644
--- a/test cases/common/44 pkgconfig-gen/test.json
+++ b/test cases/common/44 pkgconfig-gen/test.json
@@ -7,11 +7,26 @@
{"type": "file", "file": "usr/lib/pkgconfig/libfoo.pc"},
{"type": "file", "file": "usr/lib/pkgconfig/libhello.pc"},
{"type": "file", "file": "usr/lib/pkgconfig/libhello_nolib.pc"},
+ {"type": "file", "file": "usr/lib/pkgconfig/libvartest.pc"},
+ {"type": "file", "file": "usr/lib/pkgconfig/libvartest2.pc"},
{"type": "file", "file": "usr/lib/pkgconfig/simple2.pc"},
{"type": "file", "file": "usr/lib/pkgconfig/simple3.pc"},
{"type": "file", "file": "usr/lib/pkgconfig/simple5.pc"},
{"type": "file", "file": "usr/lib/pkgconfig/simple6.pc"},
{"type": "file", "file": "usr/lib/pkgconfig/ct.pc"},
{"type": "file", "file": "usr/lib/pkgconfig/ct0.pc"}
+ ],
+ "stdout": [
+ {
+ "line": "test cases/common/44 pkgconfig-gen/meson.build:158: WARNING: Project targeting '>=0.60.0' but tried to use feature introduced in '0.62.0': pkgconfig.generate implicit variable for builtin directories."
+ },
+ {
+ "line": "test cases/common/44 pkgconfig-gen/meson.build:164: WARNING: Project targeting '>=0.60.0' but tried to use feature introduced in '0.62.0': pkgconfig.generate implicit variable for builtin directories.",
+ "count": 0
+ },
+ {
+ "comment": "This will either match in the future-deprecated notice summary, or match the warning summary",
+ "line": " * 0.62.0: {'pkgconfig.generate variable for builtin directories'}"
+ }
]
}