aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-02-15 11:36:47 -0800
committerDylan Baker <dylan@pnwbakers.com>2023-02-16 09:13:52 -0800
commit295111d909a9469032b178606e978fd906e8eaf2 (patch)
treea8a9f97b37bb359f672d7782ccbb58bd8c97e986
parentb2473b61cc2c61218f5be4057af0e42b63d00048 (diff)
downloadmeson-295111d909a9469032b178606e978fd906e8eaf2.zip
meson-295111d909a9469032b178606e978fd906e8eaf2.tar.gz
meson-295111d909a9469032b178606e978fd906e8eaf2.tar.bz2
docs/prebuilt: use meson.override_dependency()
-rw-r--r--docs/markdown/Shipping-prebuilt-binaries-as-wraps.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/markdown/Shipping-prebuilt-binaries-as-wraps.md b/docs/markdown/Shipping-prebuilt-binaries-as-wraps.md
index ebbe34e..44194e7 100644
--- a/docs/markdown/Shipping-prebuilt-binaries-as-wraps.md
+++ b/docs/markdown/Shipping-prebuilt-binaries-as-wraps.md
@@ -14,19 +14,21 @@ library at the top level and headers in a subdirectory called
`include`. The Meson build definition would look like the following.
```meson
-project('binary dep', 'c')
+project('bob', 'c')
cc = meson.get_compiler('c')
-bin_dep = declare_dependency(
+bob_dep = declare_dependency(
dependencies : cc.find_library('bob', dirs : meson.current_source_dir()),
include_directories : include_directories('include'))
+
+meson.override_dependency('bob', bob_dep)
```
Now you can use this subproject as if it was a Meson project:
```meson
project('using dep', 'c')
-bob_dep = subproject('bob').get_variable('bin_dep')
+bob_dep = dependency('bob')
executable('prog', 'prog.c', dependencies : bob_dep)
```