llvm-project/libc/utils/FPUtil/CMakeLists.txt
Siva Chandra Reddy dba14814a6 [libc][NFC] Make few maths functions buildable outside of LLVM libc build.
Few math functions manipulate errno. They assumed that LLVM libc's errno
is available. However, that might not be the case when these functions
are used in a libc which does not use LLVM libc's errno. This change
switches such uses of LLVM libc's errno to the normal public errno macro.
This does not affect LLVM libc's build because the include order ensures
we get LLVM libc's errno. Also, the header check rule ensures we are only
including LLVM libc's errno.h.
2021-02-16 09:14:29 -08:00

50 lines
1.0 KiB
CMake

if(${LIBC_TARGET_MACHINE} MATCHES "^x86.*")
set(LONG_DOUBLE_HDR LongDoubleBitsX86.h)
else()
set(LONG_DOUBLE_HDR)
endif()
if(EXISTS ${LIBC_TARGET_MACHINE})
set(FENV_IMPL ${LIBC_TARGET_MACHINE}/FEnv.h)
else()
set(FENV_IMPL DummyFEnv.h)
endif()
add_header_library(
fputil
HDRS
${LONG_DOUBLE_HDR}
${FENV_IMPL}
BasicOperations.h
BitPatterns.h
ClassificationFunctions.h
DivisionAndRemainderOperations.h
FEnv.h
FloatOperations.h
FloatProperties.h
FPBits.h
BasicOperations.h
ManipulationFunctions.h
NearestIntegerOperations.h
NormalFloat.h
DEPENDS
libc.include.math
libc.include.errno
libc.include.fenv
libc.utils.CPP.standalone_cpp
)
add_llvm_library(
LibcFPTestHelpers
TestHelpers.cpp
TestHelpers.h
)
target_include_directories(LibcFPTestHelpers PUBLIC ${LIBC_SOURCE_DIR})
target_link_libraries(LibcFPTestHelpers LibcUnitTest LLVMSupport)
add_dependencies(
LibcFPTestHelpers
LibcUnitTest
libc.utils.CPP.standalone_cpp
libc.utils.FPUtil.fputil
)