CMake: Show check_symbol_exists messages only once

Same behaviour as the built-in check functions.
This commit is contained in:
Maarten Bent
2026-04-11 20:18:37 +02:00
parent 8c1ede6607
commit 8ade35509a
+7 -3
View File
@@ -183,13 +183,17 @@ else()
function(wx_check_symbols_exist_if_not_linux header)
foreach(func ${ARGN})
string(TOUPPER "HAVE_${func}" var)
message(STATUS "Looking for ${func} in ${header}")
set(MSG_TYPE STATUS)
if(DEFINED ${var})
set(MSG_TYPE DEBUG)
endif()
message(${MSG_TYPE} "Looking for ${func} in ${header}")
check_symbol_exists(${func} ${header} ${var})
if(${var})
message(STATUS "Looking for ${func} in ${header} - found")
message(${MSG_TYPE} "Looking for ${func} in ${header} - found")
set(${var} 1 PARENT_SCOPE)
else()
message(STATUS "Looking for ${func} in ${header} - not found")
message(${MSG_TYPE} "Looking for ${func} in ${header} - not found")
endif()
endforeach()
endfunction()