summaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2025-06-27 22:44:39 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-08-01 13:35:14 +0300
commita82c5450577227c7d93ad2ee54c4fddf59199045 (patch)
tree8a8d10e9b222d43e51a7f3eb0f0d3ed51c693448 /test cases/common
parenta0c8af21ec5a70259998b5fa6b95e04078f3ce6d (diff)
downloadmeson-a82c5450577227c7d93ad2ee54c4fddf59199045.tar.gz
modules/pkgconfig: Resolve dependencies in case of an internal dependency
When giving a dependency object as requires, allow to use the dependency from a subproject (that is an InternalDepdency).
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/283 pkgconfig subproject/meson.build13
-rw-r--r--test cases/common/283 pkgconfig subproject/simple.c6
-rw-r--r--test cases/common/283 pkgconfig subproject/simple.h6
-rw-r--r--test cases/common/283 pkgconfig subproject/subprojects/simple2/exports.def2
-rw-r--r--test cases/common/283 pkgconfig subproject/subprojects/simple2/meson.build9
-rw-r--r--test cases/common/283 pkgconfig subproject/subprojects/simple2/simple2.c5
-rw-r--r--test cases/common/283 pkgconfig subproject/subprojects/simple2/simple2.h6
-rw-r--r--test cases/common/283 pkgconfig subproject/test.json15
8 files changed, 62 insertions, 0 deletions
diff --git a/test cases/common/283 pkgconfig subproject/meson.build b/test cases/common/283 pkgconfig subproject/meson.build
new file mode 100644
index 000000000..3b1335b2b
--- /dev/null
+++ b/test cases/common/283 pkgconfig subproject/meson.build
@@ -0,0 +1,13 @@
+project('simple', 'c', meson_version: '>=1.9.0')
+pkgg = import('pkgconfig')
+
+simple2_dep = dependency('simple2')
+
+simple_lib = library('simple',
+ 'simple.c',
+ dependencies: [simple2_dep]
+)
+
+pkgg.generate(simple_lib,
+requires: simple2_dep,
+)
diff --git a/test cases/common/283 pkgconfig subproject/simple.c b/test cases/common/283 pkgconfig subproject/simple.c
new file mode 100644
index 000000000..da1d909f7
--- /dev/null
+++ b/test cases/common/283 pkgconfig subproject/simple.c
@@ -0,0 +1,6 @@
+#include"simple.h"
+#include <simple2.h>
+
+int simple_function(void) {
+ return simple_simple_function();
+}
diff --git a/test cases/common/283 pkgconfig subproject/simple.h b/test cases/common/283 pkgconfig subproject/simple.h
new file mode 100644
index 000000000..6896bfd17
--- /dev/null
+++ b/test cases/common/283 pkgconfig subproject/simple.h
@@ -0,0 +1,6 @@
+#ifndef SIMPLE_H_
+#define SIMPLE_H_
+
+int simple_function(void);
+
+#endif
diff --git a/test cases/common/283 pkgconfig subproject/subprojects/simple2/exports.def b/test cases/common/283 pkgconfig subproject/subprojects/simple2/exports.def
new file mode 100644
index 000000000..42c911b93
--- /dev/null
+++ b/test cases/common/283 pkgconfig subproject/subprojects/simple2/exports.def
@@ -0,0 +1,2 @@
+EXPORTS
+ simple_simple_function @1
diff --git a/test cases/common/283 pkgconfig subproject/subprojects/simple2/meson.build b/test cases/common/283 pkgconfig subproject/subprojects/simple2/meson.build
new file mode 100644
index 000000000..199fea648
--- /dev/null
+++ b/test cases/common/283 pkgconfig subproject/subprojects/simple2/meson.build
@@ -0,0 +1,9 @@
+project('simple2', 'c', meson_version: '>=1.9.0')
+pkgg = import('pkgconfig')
+
+lib2 = library('simple2', 'simple2.c', vs_module_defs: 'exports.def')
+lib_dep = declare_dependency(link_with: lib2, include_directories: include_directories('.'))
+
+pkgg.generate(lib2)
+
+meson.override_dependency('simple2', lib_dep)
diff --git a/test cases/common/283 pkgconfig subproject/subprojects/simple2/simple2.c b/test cases/common/283 pkgconfig subproject/subprojects/simple2/simple2.c
new file mode 100644
index 000000000..215b2aef8
--- /dev/null
+++ b/test cases/common/283 pkgconfig subproject/subprojects/simple2/simple2.c
@@ -0,0 +1,5 @@
+#include"simple2.h"
+
+int simple_simple_function(void) {
+ return 42;
+}
diff --git a/test cases/common/283 pkgconfig subproject/subprojects/simple2/simple2.h b/test cases/common/283 pkgconfig subproject/subprojects/simple2/simple2.h
new file mode 100644
index 000000000..472e135f2
--- /dev/null
+++ b/test cases/common/283 pkgconfig subproject/subprojects/simple2/simple2.h
@@ -0,0 +1,6 @@
+#ifndef SIMPLE2_H_
+#define SIMPLE2_H_
+
+int simple_simple_function(void);
+
+#endif
diff --git a/test cases/common/283 pkgconfig subproject/test.json b/test cases/common/283 pkgconfig subproject/test.json
new file mode 100644
index 000000000..db6b52fe4
--- /dev/null
+++ b/test cases/common/283 pkgconfig subproject/test.json
@@ -0,0 +1,15 @@
+{
+ "installed": [
+ { "type": "file", "file": "usr/lib/pkgconfig/simple.pc"},
+ { "type": "file", "file": "usr/lib/pkgconfig/simple2.pc"}
+ ],
+ "matrix": {
+ "options": {
+ "default_library": [
+ { "val": "shared" },
+ { "val": "static" },
+ { "val": "both" }
+ ]
+ }
+ }
+}