aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/howtox.md
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-05-14 09:34:55 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-05-14 13:32:46 -0700
commit66f3ba9fd0fd19c4ebf94ce3873723a83046f4b5 (patch)
tree6d4d79158f4e2a8d0b5528377b2ee5e0b45ff5ad /docs/markdown/howtox.md
parentf1d00e86f1a83e2fed301c59d22f1415222b29e2 (diff)
downloadmeson-66f3ba9fd0fd19c4ebf94ce3873723a83046f4b5.zip
meson-66f3ba9fd0fd19c4ebf94ce3873723a83046f4b5.tar.gz
meson-66f3ba9fd0fd19c4ebf94ce3873723a83046f4b5.tar.bz2
Docs: Make the suggested use for the not-found dependency better [skip ci]
Diffstat (limited to 'docs/markdown/howtox.md')
-rw-r--r--docs/markdown/howtox.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/markdown/howtox.md b/docs/markdown/howtox.md
index abf7519..84546b7 100644
--- a/docs/markdown/howtox.md
+++ b/docs/markdown/howtox.md
@@ -271,6 +271,7 @@ This can be used in cases where you want a default value, but might override it
later.
```meson
+# Not needed on Windows!
my_dep = dependency('', required : false)
if host_machine.system() in ['freebsd', 'netbsd', 'openbsd', 'dragonfly']
my_dep = dependency('some dep', required : false)
@@ -278,8 +279,9 @@ elif host_machine.system() == 'linux'
my_dep = dependency('some other dep', required : false)
endif
-# Last ditch effort!
-if no my_dep.found()
- my_dep = meson.get_compiler('c').find_library('dep')
-endif
+executable(
+ 'myexe',
+ my_sources,
+ deps : [my_dep]
+)
```