Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2021-08-25 19:55:45 +0300
committerRay Molenkamp <github@lazydodo.com>2021-08-25 19:55:45 +0300
commit518b97e674a9e7cdc91bc4048a89eb8a8b37db0b (patch)
treedc38300682575298ce751ea0686cc61e91c691a8 /build_files/cmake
parent05564c8ca61d8fb3c2df32cd4ec60a540a13e4a6 (diff)
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.
Diffstat (limited to 'build_files/cmake')
-rw-r--r--build_files/cmake/platform/platform_win32.cmake4
1 files changed, 2 insertions, 2 deletions
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)