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.
This commit is contained in:
parent
05564c8ca6
commit
518b97e674
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue