Show outputs of try_compile for UUID libs (#1738)

This commit is contained in:
Ken Matsui 2023-08-22 06:24:42 -07:00 committed by GitHub
parent 83e08f4b27
commit 3723ed5e0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -236,16 +236,18 @@ if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
try_compile(normal_uuid ${CMAKE_BINARY_DIR}/cmaketest
${PROJECT_SOURCE_DIR}/cmake/tests/normal_uuid_lib_test.cc
LINK_LIBRARIES UUID_lib)
LINK_LIBRARIES UUID_lib
OUTPUT_VARIABLE NORMAL_UUID_COMPILE_OUTPUT)
try_compile(ossp_uuid ${CMAKE_BINARY_DIR}/cmaketest
${PROJECT_SOURCE_DIR}/cmake/tests/ossp_uuid_lib_test.cc
LINK_LIBRARIES UUID_lib)
LINK_LIBRARIES UUID_lib
OUTPUT_VARIABLE OSSP_UUID_COMPILE_OUTPUT)
if (normal_uuid)
add_definitions(-DUSE_OSSP_UUID=0)
elseif (ossp_uuid)
add_definitions(-DUSE_OSSP_UUID=1)
else ()
message(FATAL_ERROR "uuid lib error")
message(FATAL_ERROR "uuid lib error:\n${NORMAL_UUID_COMPILE_OUTPUT}\n${OSSP_UUID_COMPILE_OUTPUT}")
endif ()
endif (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD"