[llvm] Prevent CMake CMP0004 error (PR #132852)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 24 18:09:23 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: peter23 (peter23)
<details>
<summary>Changes</summary>
When `delayload_flags` is empty before this `set` then `delayload_flags` become equal to " ${WL}-INCLUDE:malloc" (with whitespace). And then it causes CMake error CMP0004 when used in `add_llvm_component_library(LLVMSupport ...`.
---
Full diff: https://github.com/llvm/llvm-project/pull/132852.diff
1 Files Affected:
- (modified) llvm/lib/Support/CMakeLists.txt (+1-1)
``````````diff
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 2754c97fce6c1..f767826282002 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -112,7 +112,7 @@ if(LLVM_INTEGRATED_CRT_ALLOC)
if((LLVM_INTEGRATED_CRT_ALLOC MATCHES "rpmalloc$") OR LLVM_ENABLE_RPMALLOC)
add_compile_definitions(ENABLE_OVERRIDE ENABLE_PRELOAD)
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/rpmalloc/rpmalloc.c")
- set(delayload_flags "${delayload_flags} ${WL}-INCLUDE:malloc")
+ set(delayload_flags ${delayload_flags} "${WL}-INCLUDE:malloc")
elseif(LLVM_INTEGRATED_CRT_ALLOC MATCHES "snmalloc$")
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/src/snmalloc/override/new.cc")
set(system_libs ${system_libs} "mincore.lib" "${WL}-INCLUDE:malloc")
``````````
</details>
https://github.com/llvm/llvm-project/pull/132852
More information about the llvm-commits
mailing list