diff options
author | Guillaume Poirier-Morency <guillaumepoiriermorency@gmail.com> | 2017-05-11 22:06:58 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-05-13 23:45:13 +0300 |
commit | a7fee9bd488ed83c4c96459889dfaab93b71aa69 (patch) | |
tree | 0f0fa72be49dc146b820c68c95efe5a658874259 /docs/markdown/Vala.md | |
parent | 076ce56425e37961e624d00364294a3617ad2e15 (diff) | |
download | meson-a7fee9bd488ed83c4c96459889dfaab93b71aa69.zip meson-a7fee9bd488ed83c4c96459889dfaab93b71aa69.tar.gz meson-a7fee9bd488ed83c4c96459889dfaab93b71aa69.tar.bz2 |
vala: Cover 'find_library' usage and be more explicit for default install directories in docs
Diffstat (limited to 'docs/markdown/Vala.md')
-rw-r--r-- | docs/markdown/Vala.md | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/markdown/Vala.md b/docs/markdown/Vala.md index 259ebd1..3a3d1e6 100644 --- a/docs/markdown/Vala.md +++ b/docs/markdown/Vala.md @@ -36,9 +36,21 @@ foo_dep = dependency('foo') # 'foo.vapi' will be resolved in './vapi/foo.vapi' executable('app', 'app.vala', dependencies: [glib_dep, gobject_dep, foo_dep]) ``` +In this case, make sure that the VAPI name correspond to the pkg-config file. + +If no pkg-config file is provided, you must use `find_library`. Using`declare_dependency` is cleaner because it does not require passing both dependency objects to the target. + +```meson +foo_lib = meson.get_compiler('vala').find_library('foo') # assuming libfoo.so is installed +foo_vapi = meson.get_compiler('vala').find_library('foo', dirs: join_paths(meson.current_source_dir(), 'vapi') +foo_dep = declare_dependency(dependencies: [foo_lib, foo_vapi]) + +executable('app', 'app.vala', dependencies: [glib_dep, gobject_dep, foo_dep]) +``` + ## Custom output names -If a library target is used, Meson automatically output the C header and the VAPI. They can be renamed by setting the `vala_header` and `vala_vapi` arguments respectively. In this case, the second and third elements of the `install_dir` array indicate the destination with `true` to indicate default directories. +If a library target is used, Meson automatically output the C header and the VAPI. They can be renamed by setting the `vala_header` and `vala_vapi` arguments respectively. In this case, the second and third elements of the `install_dir` array indicate the destination with `true` to indicate default directories (i.e. `include` and `share/vala/vapi`). ```meson foo_lib = library('foo', 'foo.vala', |