Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

has_header result cached so can't add an include dir and provide the header for subprojects #10935

Open
chrishecker opened this issue Oct 20, 2022 · 1 comment

Comments

@chrishecker
Copy link

I have a header file that is sometimes installed in the system and sometimes not. If I do a cc.has_header() check on it, and it returns false, I'd like to then add a global include directory (side comment: I wish there was a way to do this in a compiler independent manner using include_directory() instead of just a string) that will provide a version of the header to subprojects. This doesn't seem possible, because any later has_header() checks in the subprojects use the cached failure of the first call. Since they're subprojects I don't want to edit their build files to add the include there. Is there a way to tell meson to update the cache, or invalidate a cache entry?

Thanks,
Chris

@chrishecker
Copy link
Author

Hmm, I tried to work around this by just doing a compiler version check at the very top, but it appears the global arguments aren't used in the has_header compilation? And, if I force it with include_directories on the has_header in the main meson.build, then it's not cached in the subproject because I assume the args are used as a key for the cache. So, I'm kinda stuck here, unless I modify the subproject...

Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant