From 340e0df2edd7ed7af4f967a97a9e88a08358cc28 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 12 Aug 2015 17:09:25 +0000 Subject: [PATCH] Use /Zc:inline when building with MSVC. This reduces the total .obj size when building llvm from 496,690,342 to 219,334,936 bytes. llvm-svn: 244767 --- cmake/modules/HandleLLVMOptions.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index bee77c14b5b..46d60b2cf74 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -348,6 +348,8 @@ if( MSVC ) append("${flag}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endforeach(flag) + append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + # 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)