aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGuillaume Poirier-Morency <guillaumepoiriermorency@gmail.com>2017-05-12 08:44:10 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2017-05-13 23:45:13 +0300
commit05c431c0132da41c69b73ca4e3d67b92a870e482 (patch)
treec133e5535745dde1d0e88d479c05a25d4b64e147 /docs
parenta7fee9bd488ed83c4c96459889dfaab93b71aa69 (diff)
downloadmeson-05c431c0132da41c69b73ca4e3d67b92a870e482.zip
meson-05c431c0132da41c69b73ca4e3d67b92a870e482.tar.gz
meson-05c431c0132da41c69b73ca4e3d67b92a870e482.tar.bz2
vala: Fix typos and cover dependencies without pkg-config file in docs
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Vala.md16
1 files changed, 13 insertions, 3 deletions
diff --git a/docs/markdown/Vala.md b/docs/markdown/Vala.md
index 3a3d1e6..7674cf3 100644
--- a/docs/markdown/Vala.md
+++ b/docs/markdown/Vala.md
@@ -36,21 +36,31 @@ 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.
+In this case, make sure that the VAPI name corresponds 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_lib = meson.get_compiler('c').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])
```
+## VAPI without pkg-config file
+
+Some Vala bindings do not need a corresponding pkg-config file and `dependency` is unsuitable for resolving them. It's necessary to use `find_library` in this case.
+
+```meson
+posix_dep = meson.get_compiler('vala').find_library('posix')
+
+executable('app', 'app.vala', dependencies: [glib_dep, gobject_dep, posix_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 (i.e. `include` and `share/vala/vapi`).
+If a library target is used, Meson automatically outputs 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',