aboutsummaryrefslogtreecommitdiff
path: root/test cases/vala
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-03-13 03:45:10 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-04-04 14:59:13 +0530
commit57cb1f9aad0928e167018ba886e2d8c06225b515 (patch)
treefd5a35a19ef7d4f384b3f14ea21494fd0a139aae /test cases/vala
parent99649e66908693c58fa0c015dbcce19ad8f55b19 (diff)
downloadmeson-57cb1f9aad0928e167018ba886e2d8c06225b515.zip
meson-57cb1f9aad0928e167018ba886e2d8c06225b515.tar.gz
meson-57cb1f9aad0928e167018ba886e2d8c06225b515.tar.bz2
Support multiple install dirs for built/custom targets
You can now pass a list of strings to the install_dir: kwarg to build_target and custom_target. Custom Targets: =============== Allows you to specify the installation directory for each corresponding output. For example: custom_target('different-install-dirs', output : ['first.file', 'second.file'], ... install : true, install_dir : ['somedir', 'otherdir]) This would install first.file to somedir and second.file to otherdir. If only one install_dir is provided, all outputs are installed there (same behaviour as before). To only install some outputs, pass `false` for the outputs that you don't want installed. For example: custom_target('only-install-second', output : ['first.file', 'second.file'], ... install : true, install_dir : [false, 'otherdir]) This would install second.file to otherdir and not install first.file. Build Targets: ============== With build_target() (which includes executable(), library(), etc), usually there is only one primary output. However some types of targets have multiple outputs. For example, while generating Vala libraries, valac also generates a header and a .vapi file both of which often need to be installed. This allows you to specify installation directories for those too. # This will only install the library (same as before) shared_library('somevalalib', 'somesource.vala', ... install : true) # This will install the library, the header, and the vapi into the # respective directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : ['libdir', 'incdir', 'vapidir']) # This will install the library into the default libdir and # everything else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [true, 'incdir', 'vapidir']) # This will NOT install the library, and will install everything # else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [false, 'incdir', 'vapidir']) true/false can also be used for secondary outputs in the same way. Valac can also generate a GIR file for libraries when the `vala_gir:` keyword argument is passed to library(). In that case, `install_dir:` must be given a list with four elements, one for each output. Includes tests for all these. Closes https://github.com/mesonbuild/meson/issues/705 Closes https://github.com/mesonbuild/meson/issues/891 Closes https://github.com/mesonbuild/meson/issues/892 Closes https://github.com/mesonbuild/meson/issues/1178 Closes https://github.com/mesonbuild/meson/issues/1193
Diffstat (limited to 'test cases/vala')
-rw-r--r--test cases/vala/7 shared library/installed_files.txt8
-rw-r--r--test cases/vala/7 shared library/lib/meson.build32
2 files changed, 40 insertions, 0 deletions
diff --git a/test cases/vala/7 shared library/installed_files.txt b/test cases/vala/7 shared library/installed_files.txt
new file mode 100644
index 0000000..16ea442
--- /dev/null
+++ b/test cases/vala/7 shared library/installed_files.txt
@@ -0,0 +1,8 @@
+usr/lib/libinstalled_vala_lib.so
+usr/lib/libinstalled_vala_all.so
+usr/include/installed_vala_all.h
+usr/include/installed_vala_all_nolib.h
+usr/include/installed_vala_onlyh.h
+usr/share/vala/vapi/installed_vala_all.vapi
+usr/share/vala/vapi/installed_vala_all_nolib.vapi
+usr/share/vala/vapi/installed_vala_onlyvapi.vapi
diff --git a/test cases/vala/7 shared library/lib/meson.build b/test cases/vala/7 shared library/lib/meson.build
index 8eca0d4..bb1e800 100644
--- a/test cases/vala/7 shared library/lib/meson.build
+++ b/test cases/vala/7 shared library/lib/meson.build
@@ -1 +1,33 @@
l = shared_library('valalib', 'mylib.vala', dependencies : valadeps)
+
+shared_library('installed_vala_lib', 'mylib.vala',
+ dependencies : valadeps,
+ install : true)
+
+shared_library('installed_vala_all', 'mylib.vala',
+ dependencies : valadeps,
+ install : true,
+ install_dir : [true,
+ join_paths(get_option('prefix'), get_option('includedir')),
+ join_paths(get_option('prefix'), get_option('datadir'), 'vala', 'vapi')])
+
+shared_library('installed_vala_all_nolib', 'mylib.vala',
+ dependencies : valadeps,
+ install : true,
+ install_dir : [false,
+ join_paths(get_option('prefix'), get_option('includedir')),
+ join_paths(get_option('prefix'), get_option('datadir'), 'vala', 'vapi')])
+
+shared_library('installed_vala_onlyh', 'mylib.vala',
+ dependencies : valadeps,
+ install : true,
+ install_dir : [false,
+ join_paths(get_option('prefix'), get_option('includedir')),
+ false])
+
+shared_library('installed_vala_onlyvapi', 'mylib.vala',
+ dependencies : valadeps,
+ install : true,
+ install_dir : [false,
+ false,
+ join_paths(get_option('prefix'), get_option('datadir'), 'vala', 'vapi')])