I need to use the linker flag /INCREMENTAL:YES
when building some libraries with Visual Studio, but cmake seems to insist on using /INCREMENTAL:NO
with release builds, and I can't figure out how to fix it. Some of the stuff that I've tried is
set(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:YES")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/INCREMENTAL:YES")
set(CMAKE_EXE_LINKER_FLAGS_INIT "/INCREMENTAL:YES")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:YES")
set(CMAKE_CXX_FLAGS_RELEASE "/INCREMENTAL:YES ${CMAKE_CXX_FLAGS_RELEASE}")
Nothing fixes the problem. As far as I can tell, cmake is just plain hardwired to think that a release build must use /INCREMENTAL:NO
. Does anyone know how to fix that and make it use /INCREMENTAL:YES
?