From: Hans Wennborg Date: Thu, 10 Sep 2020 17:32:45 +0000 (+0200) Subject: [Support] Make building with snmalloc work X-Git-Tag: llvmorg-13-init~12069 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b58eb50d96b80323504d87ca2f39ee3d7abc7d5;p=platform%2Fupstream%2Fllvm.git [Support] Make building with snmalloc work Differential revision: https://reviews.llvm.org/D87471 --- diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index 01bf8fe..45fe23c 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -65,7 +65,6 @@ if(LLVM_INTEGRATED_CRT_ALLOC) 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 @@ endif() 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