[PATCH] D87471: [Support] Make building with snmalloc work
Hans Wennborg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 05:17:04 PDT 2020
hans updated this revision to Diff 291546.
hans added a comment.
Added target condition.
Please take another look.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87471/new/
https://reviews.llvm.org/D87471
Files:
llvm/lib/Support/CMakeLists.txt
Index: llvm/lib/Support/CMakeLists.txt
===================================================================
--- llvm/lib/Support/CMakeLists.txt
+++ llvm/lib/Support/CMakeLists.txt
@@ -65,7 +65,6 @@
add_definitions(-DENABLE_OVERRIDE -DENABLE_PRELOAD)
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/rpmalloc/rpmalloc.c")
elseif(LLVM_INTEGRATED_CRT_ALLOC MATCHES "snmalloc$")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17" PARENT_SCOPE)
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/src/override/malloc.cc" "${LLVM_INTEGRATED_CRT_ALLOC}/src/override/new.cc")
set(system_libs ${system_libs} "mincore.lib" "-INCLUDE:malloc")
elseif(LLVM_INTEGRATED_CRT_ALLOC MATCHES "mimalloc$")
@@ -249,6 +248,18 @@
set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${llvm_system_libs}")
+
+if(LLVM_INTEGRATED_CRT_ALLOC)
+ if(LLVM_INTEGRATED_CRT_ALLOC MATCHES "snmalloc$")
+ set_property(TARGET LLVMSupport PROPERTY CXX_STANDARD 17)
+ add_definitions(-D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING)
+ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND
+ "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
+ set_property(TARGET LLVMSupport PROPERTY COMPILE_FLAGS "-mcx16")
+ endif()
+ endif()
+endif()
+
if(LLVM_WITH_Z3)
target_include_directories(LLVMSupport SYSTEM
PRIVATE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87471.291546.patch
Type: text/x-patch
Size: 1349 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200914/4fd47a40/attachment.bin>
More information about the llvm-commits
mailing list