aboutsummaryrefslogtreecommitdiff
path: root/test cases/common/253 subproject dependency variables
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2022-10-24 22:26:06 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2022-10-24 22:26:06 +0300
commit8b5164f9bc204e0c7419b8e00025eff42d03c42f (patch)
tree020ce1c6874420191735c22a7665fa1392d68db7 /test cases/common/253 subproject dependency variables
parent5a7427cebb9093387f3f5e202b033db2516f9b30 (diff)
downloadmeson-8b5164f9bc204e0c7419b8e00025eff42d03c42f.zip
meson-8b5164f9bc204e0c7419b8e00025eff42d03c42f.tar.gz
meson-8b5164f9bc204e0c7419b8e00025eff42d03c42f.tar.bz2
One more dircondensation for rc1.dirc2
Diffstat (limited to 'test cases/common/253 subproject dependency variables')
-rw-r--r--test cases/common/253 subproject dependency variables/meson.build18
-rw-r--r--test cases/common/253 subproject dependency variables/subprojects/subfiles/foo.c1
-rw-r--r--test cases/common/253 subproject dependency variables/subprojects/subfiles/meson.build29
-rw-r--r--test cases/common/253 subproject dependency variables/subprojects/subfiles/subdir/foo.c1
-rw-r--r--test cases/common/253 subproject dependency variables/subprojects/subfiles/subdir2/foo.c1
-rw-r--r--test cases/common/253 subproject dependency variables/test.json8
6 files changed, 58 insertions, 0 deletions
diff --git a/test cases/common/253 subproject dependency variables/meson.build b/test cases/common/253 subproject dependency variables/meson.build
new file mode 100644
index 0000000..403b6f1
--- /dev/null
+++ b/test cases/common/253 subproject dependency variables/meson.build
@@ -0,0 +1,18 @@
+project('subproject dependency variables', 'c')
+
+subfiles_dep = subproject('subfiles').get_variable('files_dep')
+
+executable(
+ 'foo',
+ join_paths(subfiles_dep.get_variable('pkgdatadir'), 'foo.c')
+)
+
+executable(
+ 'foo2',
+ subfiles_dep.get_variable('pkgdatadir2') / 'foo.c'
+)
+
+executable(
+ 'foor32',
+ subfiles_dep.get_variable('pkgdatadir3') / 'foo.c'
+)
diff --git a/test cases/common/253 subproject dependency variables/subprojects/subfiles/foo.c b/test cases/common/253 subproject dependency variables/subprojects/subfiles/foo.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/test cases/common/253 subproject dependency variables/subprojects/subfiles/foo.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/test cases/common/253 subproject dependency variables/subprojects/subfiles/meson.build b/test cases/common/253 subproject dependency variables/subprojects/subfiles/meson.build
new file mode 100644
index 0000000..f5ad0f2
--- /dev/null
+++ b/test cases/common/253 subproject dependency variables/subprojects/subfiles/meson.build
@@ -0,0 +1,29 @@
+project('dependency variable resource')
+
+files_dep = declare_dependency(
+ variables: [
+ 'pkgdatadir=@0@/subdir'.format(meson.current_source_dir()),
+ 'pkgdatadir2=@0@/subdir2'.format(meson.current_source_dir()),
+ 'pkgdatadir3=@0@'.format(meson.current_source_dir()),
+ ]
+)
+
+install_data('subdir/foo.c', install_dir: get_option('datadir') / 'subdir')
+install_subdir('subdir2', install_dir: get_option('datadir'))
+install_data('foo.c', install_dir: get_option('datadir'))
+
+import('pkgconfig').generate(
+ name: 'depvar_resource',
+ description: 'Get a resource file from pkgconfig or a subproject',
+ version: '0.1',
+ variables: [
+ 'pkgdatadir=${datadir}/subdir',
+ 'pkgdatadir2=${datadir}/subdir2',
+ ],
+ uninstalled_variables: [
+ 'pkgdatadir=@0@/subdir'.format(meson.current_source_dir()),
+ 'pkgdatadir2=@0@/subdir2'.format(meson.current_source_dir()),
+ 'pkgdatadir3=@0@'.format(meson.current_source_dir()),
+ ],
+ dataonly: true,
+)
diff --git a/test cases/common/253 subproject dependency variables/subprojects/subfiles/subdir/foo.c b/test cases/common/253 subproject dependency variables/subprojects/subfiles/subdir/foo.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/test cases/common/253 subproject dependency variables/subprojects/subfiles/subdir/foo.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/test cases/common/253 subproject dependency variables/subprojects/subfiles/subdir2/foo.c b/test cases/common/253 subproject dependency variables/subprojects/subfiles/subdir2/foo.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/test cases/common/253 subproject dependency variables/subprojects/subfiles/subdir2/foo.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/test cases/common/253 subproject dependency variables/test.json b/test cases/common/253 subproject dependency variables/test.json
new file mode 100644
index 0000000..c345bbe
--- /dev/null
+++ b/test cases/common/253 subproject dependency variables/test.json
@@ -0,0 +1,8 @@
+{
+ "installed": [
+ { "type": "file", "file": "usr/share/pkgconfig/depvar_resource.pc" },
+ { "type": "file", "file": "usr/share/foo.c" },
+ { "type": "file", "file": "usr/share/subdir/foo.c" },
+ { "type": "file", "file": "usr/share/subdir2/foo.c" }
+ ]
+}