Michael Jones bf0ded805a [libc][NFC] split standalone_cpp into single headers
Previously, the entire support/CPP folder was in one header library,
which meant that a lot of headers were included where they shouldn't be.
This patch splits each header into its own target, as well as adjusting
each place they were included to only include what is used.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D121237
2022-03-08 11:56:08 -08:00

24 lines
702 B
CMake

if(LIBC_TESTS_CAN_USE_MPFR)
add_library(libcMPFRWrapper
MPFRUtils.cpp
MPFRUtils.h
)
add_compile_options(
-O3
)
add_dependencies(
libcMPFRWrapper
libc.src.__support.CPP.string_view
libc.src.__support.CPP.type_traits
libc.src.__support.FPUtil.fputil
LibcUnitTest
)
if(EXISTS ${LLVM_LIBC_MPFR_INSTALL_PATH})
target_include_directories(libcMPFRWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH}/include)
target_link_directories(libcMPFRWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH}/lib)
endif()
target_link_libraries(libcMPFRWrapper LibcFPTestHelpers LibcUnitTest mpfr gmp)
else()
message(WARNING "Math tests using MPFR will be skipped.")
endif()