Skip to content

Commit ab24e01

Browse files
committed
Fixed cmake config in case of LLVM_ENABLE_RPMALLOC=ON and non MSVC compiler
This patch fixes the following error in case of LLVM_ENABLE_RPMALLOC=ON and clang or other non MSVC compiler ``` CMake Error at cmake/modules/AddLLVM.cmake:644 (add_library): Target "LLVMSupport" links to item " -INCLUDE:malloc" which has leading or trailing whitespace. This is now an error according to policy CMP0004. Call Stack (most recent call first): cmake/modules/AddLLVM.cmake:944 (llvm_add_library) cmake/modules/AddLLVM.cmake:917 (add_llvm_library) lib/Support/CMakeLists.txt:139 (add_llvm_component_library) ``` The behavior is the same with CMake 3.25.3 and 4.0.2
1 parent 70cf616 commit ab24e01

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Support/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ if(LLVM_INTEGRATED_CRT_ALLOC)
113113
add_compile_definitions(ENABLE_OVERRIDE ENABLE_PRELOAD)
114114
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/rpmalloc/rpmalloc.c")
115115
set(delayload_flags "${delayload_flags} ${WL}-INCLUDE:malloc")
116+
string(STRIP ${delayload_flags} delayload_flags)
116117
elseif(LLVM_INTEGRATED_CRT_ALLOC MATCHES "snmalloc$")
117118
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/src/snmalloc/override/new.cc")
118119
set(system_libs ${system_libs} "mincore.lib" "${WL}-INCLUDE:malloc")

0 commit comments

Comments
 (0)