From 3723ed5e0c23e6625b87c485cbe5748a9cde40bf Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Tue, 22 Aug 2023 06:24:42 -0700 Subject: [PATCH] Show outputs of try_compile for UUID libs (#1738) --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db95642e..5d0df883 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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"