aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorFlorian "sp1rit"​ <sp1ritCS@protonmail.com>2022-04-23 00:02:13 +0200
committerEli Schwartz <eschwartz93@gmail.com>2022-05-30 18:03:01 -0400
commitad8f24f232290b778dad1152583820512ecf9f63 (patch)
tree647218dcbfad61599bfcf77b3e79dd43d29e52b1 /test cases
parent37fea630338a93cf7b8b6e91a38d45431d92bc5b (diff)
downloadmeson-ad8f24f232290b778dad1152583820512ecf9f63.zip
meson-ad8f24f232290b778dad1152583820512ecf9f63.tar.gz
meson-ad8f24f232290b778dad1152583820512ecf9f63.tar.bz2
Implement `preserve_path` for install_headers
The `install_headers` function now has an optional argument `preserve_path` that allows installing multi-directory headerfile structures that live alongside sourcecode with a single command. For example, the headerfile structure headers = [ 'one.h', 'two.h', 'alpha/one.h', 'alpha/two.h', 'alpha/three.h' 'beta/one.h' ] can now be passed to `install_headers(headers, subdir: 'mylib', preserve_path: true)` and the resulting directory tree will look like {prefix} └── include    └── mylib       ├── alpha       │   ├── one.h       │   ├── two.h       │   └── three.h       ├── beta       │   └── one.h       ├── one.h       └── two.h Fixes #3371
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/9 header install/child/childdir.h3
-rw-r--r--test cases/common/9 header install/meson.build7
-rw-r--r--test cases/common/9 header install/test.json2
3 files changed, 9 insertions, 3 deletions
diff --git a/test cases/common/9 header install/child/childdir.h b/test cases/common/9 header install/child/childdir.h
new file mode 100644
index 0000000..5788511
--- /dev/null
+++ b/test cases/common/9 header install/child/childdir.h
@@ -0,0 +1,3 @@
+/* This file goes, depending on the state of `preserve_path` into subdirectory of include root or into the `child` dir of the subdirectory of include root. */
+
+int childdir_func();
diff --git a/test cases/common/9 header install/meson.build b/test cases/common/9 header install/meson.build
index 833b4d4..8c83be6 100644
--- a/test cases/common/9 header install/meson.build
+++ b/test cases/common/9 header install/meson.build
@@ -1,11 +1,12 @@
project('header install')
-as_array = ['subdir.h']
+as_array = ['subdir.h', 'child/childdir.h']
subdir('vanishing_subdir')
subdir('sub')
h1 = install_headers('rootdir.h')
h2 = install_headers(as_array, subdir : 'subdir')
-h3 = install_headers(subheader)
-h4 = install_headers(disabler())
+h3 = install_headers(as_array, subdir : 'subdir', preserve_path : true)
+h4 = install_headers(subheader)
+h5 = install_headers(disabler())
diff --git a/test cases/common/9 header install/test.json b/test cases/common/9 header install/test.json
index eb12cd0..8514c90 100644
--- a/test cases/common/9 header install/test.json
+++ b/test cases/common/9 header install/test.json
@@ -2,6 +2,8 @@
"installed": [
{ "type": "file", "file": "usr/include/rootdir.h" },
{ "type": "file", "file": "usr/include/subdir/subdir.h" },
+ { "type": "file", "file": "usr/include/subdir/childdir.h" },
+ { "type": "file", "file": "usr/include/subdir/child/childdir.h" },
{ "type": "file", "file": "usr/include/vanished.h" },
{ "type": "file", "file": "usr/include/fileheader.h" }
]