Getting path to C/C++ standard library header directories #12454
mitchgrout
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A common problem when running custom lint jobs is being able to find where the language headers are stored. For example, I might have a basic file like
When running a linter against this (besides linters which integrate with a compiler toolchain such as clang-tidy), you might expect an error like
The expected resolution is to pass the directory containing such libraries to the linter; however, meson has no way to deduce where these files are, just that they are present. We have things like
compiler.check_header
andcompiler.find_library
, could we also have something likecompiler.system_includes()
or similar for this purpose?Implementation-wise, for GCC and clang-like compilers,
<compiler> -x <language> -E -Wp,-v empty-file
would provide the include paths for<language>
. The exact syntax for other compilers would likely be different, but surely could be extracted.Beta Was this translation helpful? Give feedback.
All reactions