diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2018-12-06 15:03:46 -0500 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2018-12-27 23:06:28 -0500 |
commit | b6cede2928e80d6bd0512c82ad6787c03faae1e6 (patch) | |
tree | 19202bffbeef80c9c2116f5909fb9a078005ae99 /docs/markdown/snippets | |
parent | ff2aa5a9ef48bc083e01d7af578799fc4eada764 (diff) | |
download | meson-b6cede2928e80d6bd0512c82ad6787c03faae1e6.zip meson-b6cede2928e80d6bd0512c82ad6787c03faae1e6.tar.gz meson-b6cede2928e80d6bd0512c82ad6787c03faae1e6.tar.bz2 |
find_library: Add 'has_headers' kwarg
A library without its headers is often useless, so it is common to check
them together.
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r-- | docs/markdown/snippets/find_library_header.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/markdown/snippets/find_library_header.md b/docs/markdown/snippets/find_library_header.md new file mode 100644 index 0000000..55597ab --- /dev/null +++ b/docs/markdown/snippets/find_library_header.md @@ -0,0 +1,21 @@ +## Find library with its headers + +The `find_library()` method can now also verify if the library's headers are +found in a single call, using the `has_header()` method internally. + +```meson +# Aborts if the 'z' library is found but not its header file +zlib = find_library('z', has_headers : 'zlib.h') +# Returns not-found if the 'z' library is found but not its header file +zlib = find_library('z', has_headers : 'zlib.h', required : false) +``` + +Any keyword argument with the `header_` prefix passed to `find_library()` will +be passed to the `has_header()` method with the prefix removed. + +```meson +libfoo = find_library('foo', + has_headers : ['foo.h', 'bar.h'], + header_prefix : '#include <baz.h>', + header_include_directories : include_directories('.')) +``` |