From 66f3ba9fd0fd19c4ebf94ce3873723a83046f4b5 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 14 May 2020 09:34:55 -0700 Subject: Docs: Make the suggested use for the not-found dependency better [skip ci] --- docs/markdown/howtox.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'docs/markdown/howtox.md') 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] +) ``` -- cgit v1.1