-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Update include directory for libcMPCWrapper target when LIBC_MPC_INSTALL_PATH is set. #124810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…PC_INSTALL_PATH is set.
@llvm/pr-subscribers-libc Author: None (lntue) ChangesFull diff: https://github.com/llvm/llvm-project/pull/124810.diff 2 Files Affected:
diff --git a/libc/cmake/modules/LLVMLibCCheckMPC.cmake b/libc/cmake/modules/LLVMLibCCheckMPC.cmake
index 633719b77575cf..6cc9ee2d9a6f61 100644
--- a/libc/cmake/modules/LLVMLibCCheckMPC.cmake
+++ b/libc/cmake/modules/LLVMLibCCheckMPC.cmake
@@ -1,7 +1,7 @@
if(LIBC_TESTS_CAN_USE_MPFR)
- set(LLVM_LIBC_MPC_INSTALL_PATH "" CACHE PATH "Path to where MPC is installed (e.g. C:/src/install or ~/src/install)")
+ set(LIBC_MPC_INSTALL_PATH "" CACHE PATH "Path to where MPC is installed (e.g. C:/src/install or ~/src/install)")
- if(LLVM_LIBC_MPC_INSTALL_PATH)
+ if(LIBC_MPC_INSTALL_PATH)
set(LIBC_TESTS_CAN_USE_MPC TRUE)
elseif(LIBC_TARGET_OS_IS_GPU OR LLVM_LIBC_FULL_BUILD)
# In full build mode, the MPC library should be built using our own facilities,
diff --git a/libc/utils/MPCWrapper/CMakeLists.txt b/libc/utils/MPCWrapper/CMakeLists.txt
index 6c12f73109a576..38e635c5539354 100644
--- a/libc/utils/MPCWrapper/CMakeLists.txt
+++ b/libc/utils/MPCWrapper/CMakeLists.txt
@@ -17,6 +17,14 @@ if(LIBC_TESTS_CAN_USE_MPC)
libc.src.__support.complex_type
LibcTest.unit
)
+ if(EXISTS ${LLVM_LIBC_MPFR_INSTALL_PATH})
+ target_include_directories(libcMPCWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH}/include)
+ target_link_directories(libcMPCWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH}/lib)
+ endif()
+ if(EXISTS ${LIBC_MPC_INSTALL_PATH})
+ target_include_directories(libcMPCWrapper PUBLIC ${LIBC_MPC_INSTALL_PATH}/include)
+ target_link_directories(libcMPCWrapper PUBLIC ${LIBC_MPC_INSTALL_PATH}/lib)
+ endif()
target_include_directories(libcMPCWrapper PUBLIC ${LIBC_SOURCE_DIR})
target_link_libraries(libcMPCWrapper PUBLIC libcMPCommon LibcFPTestHelpers.unit LibcTest.unit mpc)
elseif(NOT LIBC_TARGET_OS_IS_GPU AND NOT LLVM_LIBC_FULL_BUILD)
|
if(EXISTS ${LIBC_MPC_INSTALL_PATH}) | ||
target_include_directories(libcMPCWrapper PUBLIC ${LIBC_MPC_INSTALL_PATH}/include) | ||
target_link_directories(libcMPCWrapper PUBLIC ${LIBC_MPC_INSTALL_PATH}/lib) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the idea to support LLVM_
prefixed and non-prefixed LIBC_MPFR_INSTALL_PATH
simultaneously for a time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think for LLVM 21, we might provide message / warnings about switching from LLVM_LIBC_*
flags to LIBC_*
flags, and supporting both, before removing LLVM_LIBC_*
flags in LLVM 22?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good plan. Do we have a bug on file for that? If not, would you please file one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created #124860 to track that plan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.