Skip to content

Commit 133bb48

Browse files
[libc] remove MPFR and related tests in full build
1 parent 697b881 commit 133bb48

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

libc/cmake/modules/LLVMLibCCheckMPFR.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ set(LLVM_LIBC_MPFR_INSTALL_PATH "" CACHE PATH "Path to where MPFR is installed (
22

33
if(LLVM_LIBC_MPFR_INSTALL_PATH)
44
set(LIBC_TESTS_CAN_USE_MPFR TRUE)
5-
elseif(LIBC_TARGET_OS_IS_GPU)
5+
elseif(LIBC_TARGET_OS_IS_GPU OR LLVM_LIBC_FULL_BUILD)
66
set(LIBC_TESTS_CAN_USE_MPFR FALSE)
77
else()
88
try_compile(

libc/utils/MPFRWrapper/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ if(LIBC_TESTS_CAN_USE_MPFR)
55
mpfr_inc.h
66
)
77
target_compile_options(libcMPFRWrapper PRIVATE -O3)
8-
if (LLVM_LIBC_FULL_BUILD)
9-
# It is not easy to make libcMPFRWrapper a standalone library because gmp.h may unconditionally
10-
# pull in some STL headers. As a result, targets using this library will need to link against
11-
# C++ and unwind libraries. Since we are using MPFR anyway, we directly specifies the GNU toolchain.
12-
target_link_libraries(libcMPFRWrapper PUBLIC -lstdc++ -lgcc_s)
13-
endif()
148
add_dependencies(
159
libcMPFRWrapper
1610
libc.src.__support.CPP.string_view
@@ -24,6 +18,6 @@ if(LIBC_TESTS_CAN_USE_MPFR)
2418
target_link_directories(libcMPFRWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH}/lib)
2519
endif()
2620
target_link_libraries(libcMPFRWrapper PUBLIC LibcFPTestHelpers.unit LibcTest.unit mpfr gmp)
27-
elseif(NOT LIBC_TARGET_OS_IS_GPU)
21+
elseif(NOT LIBC_TARGET_OS_IS_GPU AND NOT LLVM_LIBC_FULL_BUILD)
2822
message(WARNING "Math tests using MPFR will be skipped.")
2923
endif()

libc/utils/MPFRWrapper/mpfr_inc.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,7 @@
1717
// MPFR header can be included in manner allowed in that repo.
1818
#include "CustomMPFRIncluder.h"
1919
#else
20-
21-
extern "C" {
22-
#pragma push_macro("__cplusplus")
23-
#if defined(__clang__)
24-
#pragma clang diagnostic push
25-
#pragma clang diagnostic ignored "-Wbuiltin-macro-redefined"
26-
#endif
27-
#undef __cplusplus
2820
#include <mpfr.h>
29-
#if defined(__clang__)
30-
#pragma clang diagnostic pop
31-
#endif
32-
#pragma pop_macro("__cplusplus")
33-
}
34-
3521
#endif
3622

3723
#endif // LLVM_LIBC_UTILS_MPFRWRAPPER_MPFR_INC_H

0 commit comments

Comments
 (0)