From 295111d909a9469032b178606e978fd906e8eaf2 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 15 Feb 2023 11:36:47 -0800 Subject: [PATCH] docs/prebuilt: use meson.override_dependency() --- docs/markdown/Shipping-prebuilt-binaries-as-wraps.md | 8 +++++--- 1 file 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 ebbe34ee1..44194e7bd 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) ```