[Bf-blender-cvs] [518b97e674a] master: Windows/Ninja: Optimize linker performance

Ray Molenkamp noreply at git.blender.org
Wed Aug 25 18:55:51 CEST 2021


Commit: 518b97e674a9e7cdc91bc4048a89eb8a8b37db0b
Author: Ray Molenkamp
Date:   Wed Aug 25 10:55:45 2021 -0600
Branches: master
https://developer.blender.org/rB518b97e674a9e7cdc91bc4048a89eb8a8b37db0b

Windows/Ninja: Optimize linker performance

The /Zc:inline flag is by default off in the MSVC
compiler however when you build with msbuild it adds
it to the build flags on its own.

Ninja however does not decide on its own to add
flags you didn't ask for and was building without
this flag.

This change explicitly adds the compiler flag so
msbuild and ninja builds are once more building
with the same build flags leading to smaller .obj
files when building with ninja and lightening the
workload for the linker.

This flag is available starting MSVC 2013 update 2
so does not need to be guarded with version checks.

===================================================================

M	build_files/cmake/platform/platform_win32.cmake

===================================================================

diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index d44ef691d1b..e3183fe5b7f 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -151,8 +151,8 @@ if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
   string(APPEND CMAKE_CXX_FLAGS " ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
   set(CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} /nologo /J /Gd -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference")
 else()
-  string(APPEND CMAKE_CXX_FLAGS " /nologo /J /Gd /MP /EHsc /bigobj")
-  set(CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /bigobj")
+  string(APPEND CMAKE_CXX_FLAGS " /nologo /J /Gd /MP /EHsc /bigobj /Zc:inline")
+  set(CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /bigobj /Zc:inline")
 endif()
 
 # X64 ASAN is available and usable on MSVC 16.9 preview 4 and up)



More information about the Bf-blender-cvs mailing list