cmake version 3.28.1
MinGW: MSYS_NT-10.0-22631 DESKTOP-UH4OPKD 3.4.10.x86_64 2023-12-22 10:06 UTC x86_64 Msys
I’ve been debugging a problem related to CheckSymbolExists macro. It seems that the ‘try_compile’ test is never run. The test
“if(NOT DEFINED “${VARIABLE}” OR “x${${VARIABLE}}” STREQUAL “x${VARIABLE}”)” failed.
I inserted this code in “macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE)”
unset(_MBEDTLS_V2_OR_NEWER)
if (DEFINED _MBEDTLS_V2_OR_NEWER)
message(“_MBEDTLS_V2_OR_NEWER defined”)
endif()
and it prints. I am puzzled.
The symbol being checked for is defined in the header and library. I believe that the clause "NOT DEFINED “${VARIABLE}” should have triggered. As far as I can tell, the variable being used was never set, so it should be undefined, and the ‘try_compile’ test run.