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