Use /Zc:inline when building with MSVC.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Aug 2015 17:09:25 +0000 (17:09 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Aug 2015 17:09:25 +0000 (17:09 +0000)
This reduces the total .obj size when building llvm from
496,690,342 to 219,334,936 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244767 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/HandleLLVMOptions.cmake

index bee77c1..46d60b2 100644 (file)
@@ -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)