Documentation: check_linker_flag(<lang> <flag> <var>) and check_compiler_flag(<lang> <flag> <var>) both add -D<var>to the compiler invocation
There is no documentation in
- https://cmake.org/cmake/help/latest/module/CheckCompilerFlag.html
- https://cmake.org/cmake/help/latest/module/CheckLinkerFlag.html
indicating that this will be done. This surprised me because I used the same name for <var> as I do for something inside my code, so I had a miscompilation as a result.
I assume that what's happening is the <VAR> is being added to CMAKE_REQUIRED_DEFINITIONS
by name before calling https://cmake.org/cmake/help/latest/module/CheckSourceCompiles.html
Edited by Michael Jones