aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/unit/27 pkgconfig usage
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/unit/27 pkgconfig usage
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/unit/27 pkgconfig usage')
-rw-r--r--meson/test cases/unit/27 pkgconfig usage/dependee/meson.build7
-rw-r--r--meson/test cases/unit/27 pkgconfig usage/dependee/pkguser.c6
-rw-r--r--meson/test cases/unit/27 pkgconfig usage/dependency/meson.build24
-rw-r--r--meson/test cases/unit/27 pkgconfig usage/dependency/pkgdep.c7
-rw-r--r--meson/test cases/unit/27 pkgconfig usage/dependency/pkgdep.h3
-rw-r--r--meson/test cases/unit/27 pkgconfig usage/dependency/privatelib.c3
6 files changed, 50 insertions, 0 deletions
diff --git a/meson/test cases/unit/27 pkgconfig usage/dependee/meson.build b/meson/test cases/unit/27 pkgconfig usage/dependee/meson.build
new file mode 100644
index 000000000..beb446c18
--- /dev/null
+++ b/meson/test cases/unit/27 pkgconfig usage/dependee/meson.build
@@ -0,0 +1,7 @@
+project('pkgconfig user', 'c')
+
+pkgdep = dependency('libpkgdep')
+
+executable('pkguser', 'pkguser.c',
+ dependencies : pkgdep)
+
diff --git a/meson/test cases/unit/27 pkgconfig usage/dependee/pkguser.c b/meson/test cases/unit/27 pkgconfig usage/dependee/pkguser.c
new file mode 100644
index 000000000..2bff316f1
--- /dev/null
+++ b/meson/test cases/unit/27 pkgconfig usage/dependee/pkguser.c
@@ -0,0 +1,6 @@
+#include<pkgdep.h>
+
+int main(int argc, char **argv) {
+ int res = pkgdep();
+ return res != 99;
+}
diff --git a/meson/test cases/unit/27 pkgconfig usage/dependency/meson.build b/meson/test cases/unit/27 pkgconfig usage/dependency/meson.build
new file mode 100644
index 000000000..89fae8e00
--- /dev/null
+++ b/meson/test cases/unit/27 pkgconfig usage/dependency/meson.build
@@ -0,0 +1,24 @@
+project('pkgconfig dep', 'c',
+ version : '1.0.0')
+
+# This is not used in the code, only to check that it does not
+# leak out to --libs.
+glib_dep = dependency('glib-2.0')
+
+pkgconfig = import('pkgconfig')
+
+intlib = static_library('libpkgdep-int', 'privatelib.c')
+intdep = declare_dependency(link_with : intlib)
+
+lib = shared_library('pkgdep', 'pkgdep.c',
+ dependencies : [glib_dep, intdep],
+ install : true)
+
+install_headers('pkgdep.h')
+
+pkgconfig.generate(
+ filebase : 'libpkgdep',
+ name : 'Libpkgdep',
+ description : 'Sample pkgconfig dependency library',
+ version : meson.project_version(),
+ libraries : lib)
diff --git a/meson/test cases/unit/27 pkgconfig usage/dependency/pkgdep.c b/meson/test cases/unit/27 pkgconfig usage/dependency/pkgdep.c
new file mode 100644
index 000000000..bd5c3f4d3
--- /dev/null
+++ b/meson/test cases/unit/27 pkgconfig usage/dependency/pkgdep.c
@@ -0,0 +1,7 @@
+#include<pkgdep.h>
+
+int internal_thingy();
+
+int pkgdep() {
+ return internal_thingy();
+}
diff --git a/meson/test cases/unit/27 pkgconfig usage/dependency/pkgdep.h b/meson/test cases/unit/27 pkgconfig usage/dependency/pkgdep.h
new file mode 100644
index 000000000..16d622eb1
--- /dev/null
+++ b/meson/test cases/unit/27 pkgconfig usage/dependency/pkgdep.h
@@ -0,0 +1,3 @@
+#pragma once
+
+int pkgdep();
diff --git a/meson/test cases/unit/27 pkgconfig usage/dependency/privatelib.c b/meson/test cases/unit/27 pkgconfig usage/dependency/privatelib.c
new file mode 100644
index 000000000..71d2179c3
--- /dev/null
+++ b/meson/test cases/unit/27 pkgconfig usage/dependency/privatelib.c
@@ -0,0 +1,3 @@
+int internal_thingy() {
+ return 99;
+}