llvm-project/libc/utils/MPFRWrapper/CMakeLists.txt

19 lines
388 B
CMake

try_compile(
LIBC_TESTS_CAN_USE_MPFR
${CMAKE_CURRENT_BINARY_DIR}
SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/check_mpfr.cpp
LINK_LIBRARIES
-lmpfr -lgmp
)
if(LIBC_TESTS_CAN_USE_MPFR)
add_library(libcMPFRWrapper
MPFRUtils.cpp
MPFRUtils.h
)
target_link_libraries(libcMPFRWrapper -lmpfr -lgmp)
else()
message(WARNING "Math tests using MPFR will be skipped.")
endif()