From fbc23c0713e98cb16d601c64e2e3e2a7716d2ab8 Mon Sep 17 00:00:00 2001 From: Naios Date: Thu, 17 Mar 2016 16:22:50 +0100 Subject: CMake: Disable incremental linking in msvc debug builds * Requested by Shauren --- cmake/compiler/msvc/settings.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cmake/compiler') diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake index be8028da024..8af8033d809 100644 --- a/cmake/compiler/msvc/settings.cmake +++ b/cmake/compiler/msvc/settings.cmake @@ -84,3 +84,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500") # 'function' : member function does not override any base class virtual member function # 'virtual_function' : no override available for virtual member function from base 'class'; function is hidden set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4263 /we4264") + +# Disable incremental linking in debug builds. +# To prevent linking getting stuck (which might be fixed in a later VS version). +macro(DisableIncrementalLinking variable) + string(REGEX REPLACE "/INCREMENTAL *" "" ${variable} "${${variable}}") + set(${variable} "${${variable}} /INCREMENTAL:NO") +endmacro() + +DisableIncrementalLinking(CMAKE_EXE_LINKER_FLAGS_DEBUG) +DisableIncrementalLinking(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO) +DisableIncrementalLinking(CMAKE_SHARED_LINKER_FLAGS_DEBUG) +DisableIncrementalLinking(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO) -- cgit v1.2.3