Checks if header exists and can be compiled.
check_header <header>;
check_header <header> { <attribute-statements> }
On modern system this is generally not needed, as the following code can be used:
#if __has_include (<sys/stat.h>)
# include <sys/stat.h>
#endif
Generated Name: Prefix: _header_
Example: _header_sys_stat
check_header sys/stat.h;
check_header someheader.h {
alternate {
compiler_flags '-I/opt/include';
}
alternate {
compiler_flags '-I/usr/local/include';
}
alternate {
compiler_flags '-I/opt/homebrew/include';
}
}
Wiki: Home
Wiki: Syntax
Wiki: SyntaxAttrAlternate
Wiki: SyntaxAttrCompileFlag
Wiki: SyntaxAttrHeader
Wiki: SyntaxAttrName
Wiki: SyntaxCheck