From 4bc9d4ea2648db800f0d89adc73bd43e91fc6dcf Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 19 May 2015 23:28:23 +0000 Subject: [PATCH] Try to fix the build with MSVC 2015 by disabling sized deallocation I can't actually test this properly because uninstalling MSVC 2015 CTP 6 and reinstalling the 2015 RC takes hours. I can only verify that this doesn't mess up MSVC 2013 and 2015 CTP 6 builds, which is what I've done. Should fix PR23513. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237743 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/HandleLLVMOptions.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index c052165bda4..a9368948e86 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -345,6 +345,11 @@ if( MSVC ) append("${flag}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endforeach(flag) + # Disable sized deallocation if the flag is supported. MSVC fails to compile + # the operator new overload in User otherwise. + check_c_compiler_flag("/WX /Zc:sizedDealloc-" SUPPORTS_SIZED_DEALLOC) + append_if(SUPPORTS_SIZED_DEALLOC "/Zc:sizedDealloc-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE ) if (LLVM_ENABLE_WARNINGS) append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) -- 2.34.1