mirror of
https://github.com/lifegpc/c-utils.git
synced 2026-06-06 21:28:50 +08:00
13 lines
759 B
CMake
13 lines
759 B
CMake
function(test_strerror_r OUTPUT_VAR)
|
|
if (DEFINED STRERROR_R_TEST_RESULT_CACHE)
|
|
set(${OUTPUT_VAR} ${STRERROR_R_TEST_RESULT_CACHE} PARENT_SCOPE)
|
|
message(STATUS "Check strerror_r is GNU complatable - ${STRERROR_R_TEST_RESULT_CACHE} (Cached)")
|
|
else()
|
|
message(STATUS "Check strerror_r is GNU complatable")
|
|
try_compile(STRERROR_R_TEST_RESULT "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/test_strerror_r.c")
|
|
set(STRERROR_R_TEST_RESULT_CACHE ${STRERROR_R_TEST_RESULT} CACHE BOOL "Is strerror_r is GNU complatable.")
|
|
set(${OUTPUT_VAR} ${STRERROR_R_TEST_RESULT} PARENT_SCOPE)
|
|
message(STATUS "Check strerror_r is GNU complatable - ${STRERROR_R_TEST_RESULT}")
|
|
endif()
|
|
endfunction()
|