brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 73151c6 Raw
60 lines · plain
1if(LIBC_TESTS_CAN_USE_MPFR OR LIBC_TESTS_CAN_USE_MPC)2  add_library(libcMPCommon STATIC3    MPCommon.cpp4    MPCommon.h5    mpfr_inc.h6  )7  _get_common_test_compile_options(compile_options "" "")8  # mpfr/gmp headers do not work with -ffreestanding flag.9  list(REMOVE_ITEM compile_options "-ffreestanding")10  target_compile_options(libcMPCommon PRIVATE -O3 ${compile_options})11  add_dependencies(12    libcMPCommon13    libc.hdr.stdint_proxy14    libc.src.__support.CPP.string15    libc.src.__support.CPP.string_view16    libc.src.__support.CPP.type_traits17    libc.src.__support.FPUtil.bfloat1618    libc.src.__support.FPUtil.cast19    libc.src.__support.FPUtil.fp_bits20  )21  if(EXISTS ${LLVM_LIBC_MPFR_INSTALL_PATH})22    target_include_directories(libcMPCommon PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH}/include)23    target_link_directories(libcMPCommon PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH}/lib)24  endif()25  target_include_directories(libcMPCommon PUBLIC ${LIBC_SOURCE_DIR})26  target_link_libraries(libcMPCommon PUBLIC LibcFPTestHelpers.unit mpfr gmp)27elseif(NOT LIBC_TARGET_OS_IS_GPU AND NOT LLVM_LIBC_FULL_BUILD)28  message(WARNING "Math tests using MPFR will be skipped.")29endif()30 31if(LIBC_TESTS_CAN_USE_MPFR)32  add_library(libcMPFRWrapper STATIC33    MPFRUtils.cpp34    MPFRUtils.h35  )36  _get_common_test_compile_options(compile_options "" "")37  # mpfr/gmp headers do not work with -ffreestanding flag.38  list(REMOVE_ITEM compile_options "-ffreestanding")39  target_compile_options(libcMPFRWrapper PRIVATE ${libc_opt_high_flag} ${compile_options})40  add_dependencies(41    libcMPFRWrapper42    libcMPCommon43    libc.hdr.stdint_proxy44    libc.src.__support.CPP.array45    libc.src.__support.CPP.stringstream46    libc.src.__support.FPUtil.bfloat1647    libc.src.__support.FPUtil.fp_bits48    libc.src.__support.FPUtil.fpbits_str49    LibcTest.unit50  )51  if(EXISTS ${LLVM_LIBC_MPFR_INSTALL_PATH})52    target_include_directories(libcMPFRWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH}/include)53    target_link_directories(libcMPFRWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH}/lib)54  endif()55  target_include_directories(libcMPFRWrapper PUBLIC ${LIBC_SOURCE_DIR})56  target_link_libraries(libcMPFRWrapper PUBLIC libcMPCommon LibcFPTestHelpers.unit LibcTest.unit)57elseif(NOT LIBC_TARGET_OS_IS_GPU AND NOT LLVM_LIBC_FULL_BUILD)58  message(WARNING "Math tests using MPFR will be skipped.")59endif()60