mirror of
https://github.com/lifegpc/c-utils.git
synced 2026-07-08 01:30:39 +08:00
Fix test_strerror_r not works
This commit is contained in:
@@ -47,18 +47,20 @@ endif()
|
||||
check_symbol_exists(strcasecmp "string.h" HAVE_STRCASECMP)
|
||||
check_symbol_exists(strncasecmp "string.h" HAVE_STRNCASECMP)
|
||||
check_symbol_exists(strerror_r "string.h" HAVE_STRERROR_R)
|
||||
if (HAVE_STRERROR_R)
|
||||
test_strerror_r(HAVE_GNU_STRERROR_R)
|
||||
endif()
|
||||
set(HAVE_GNU_SOURCE OFF)
|
||||
if (NOT WIN32)
|
||||
set(TMP "${CMAKE_REQUIRED_DEFINITIONS}")
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
|
||||
check_symbol_exists(fcloseall "stdio.h" HAVE_FCLOSEALL)
|
||||
if (HAVE_FCLOSEALL)
|
||||
add_compile_definitions(_GNU_SOURCE)
|
||||
set(HAVE_GNU_SOURCE ON)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "${TMP}")
|
||||
endif()
|
||||
if (HAVE_STRERROR_R)
|
||||
test_strerror_r(HAVE_GNU_STRERROR_R ${HAVE_GNU_SOURCE})
|
||||
endif()
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/utils_config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/utils_config.h")
|
||||
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL GNU)
|
||||
|
||||
Reference in New Issue
Block a user