-
Notifications
You must be signed in to change notification settings - Fork 14.3k
libc/cmake: don't fail if LLVM_VERSION_SUFFIX isn't defined #126359
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
@llvm/pr-subscribers-libc Author: Sylvestre Ledru (sylvestre) ChangesCloses: #126358 cc @samvangysegem Full diff: https://github.com/llvm/llvm-project/pull/126359.diff 1 Files Affected:
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 1c4c0cd5aa22ba..d44769721c918f 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -51,7 +51,11 @@ set(LIBC_KERNEL_HEADERS "/usr/include" CACHE STRING "Path to Linux kernel header
# Defining a global namespace to enclose all libc functions.
set(default_namespace "__llvm_libc")
if(LLVM_VERSION_MAJOR)
- string(REPLACE "-" "" NS_LLVM_VERSION_SUFFIX ${LLVM_VERSION_SUFFIX})
+ if(DEFINED LLVM_VERSION_SUFFIX AND NOT "${LLVM_VERSION_SUFFIX}" STREQUAL "")
+ string(REPLACE "-" "" NS_LLVM_VERSION_SUFFIX "${LLVM_VERSION_SUFFIX}")
+ else()
+ set(NS_LLVM_VERSION_SUFFIX "")
+ endif()
set(default_namespace "__llvm_libc_${LLVM_VERSION_MAJOR}_${LLVM_VERSION_MINOR}_${LLVM_VERSION_PATCH}_${NS_LLVM_VERSION_SUFFIX}")
endif()
set(LIBC_NAMESPACE ${default_namespace}
|
Thanks @sylvestre for the patch! Sorry I missed that this would be an issue in my review of #126193. Note: that got backported to release/20.x, so this will need to be backported as well. As such, I'll tag #126358 as a release blocker. Sorry for the mess; or rather thank you for cleaning up my mess! |
sorry for the latency, crazy week |
/cherry-pick c81139f |
/pull-request #127099 |
) Closes: llvm#126358 cc @samvangysegem --------- Co-authored-by: Joseph Huber <[email protected]>
) Closes: llvm#126358 cc @samvangysegem --------- Co-authored-by: Joseph Huber <[email protected]> (cherry picked from commit c81139f)
) Closes: llvm#126358 cc @samvangysegem --------- Co-authored-by: Joseph Huber <[email protected]>
Closes: #126358
cc @samvangysegem