Using dependencies to enhance header search path with compiler.has_header
#12745
Unanswered
mitchgrout
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say I'm consuming some dependency,
foo
. This dependency might have a header in it namedfoo/config.h
, and I would like to detect this within meson.My immediate thought is to write the following code:
However, this fails even if a
#include <foo/config.h>
would otherwise pass in an equivalent executable. My guess it that thedependencies
part ofcompiler.check_header
does not contribute include headers (as evidenced by themeson-logs.txt
command), which seems odd?My question is whether this is intentional, and if so what benefit it serves?
My intended use for this is primarily for sanity checking, since I want to detect if a
<libname>-config
dependency exists, and if so assert that the corresponding<libname>/config.h
header exists to avoid getting the error deferred to compilation. It's effectively like a replacement for__has_include
.Beta Was this translation helpful? Give feedback.
All reactions