From 246a1050063893cf82602f28f2827628e668e7e3 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Mon, 29 Feb 2016 22:43:18 +0000 Subject: [PATCH] Force incremental linking to be off for MSVC. Whilst I'm here copy the stacksize flag used in the Python building system. This was an effort to try and stop the Visual Studio build from emitting the error message ``` 70>LINK : fatal error LNK1104: cannot open file 'C:\Users\dan\dev\z3-1\build_console\Debug\z3.ilk' ``` Unfortunately this has not fixed the issue. --- cmake/compiler_flags_override.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/compiler_flags_override.cmake b/cmake/compiler_flags_override.cmake index d78b90601..26785a614 100644 --- a/cmake/compiler_flags_override.cmake +++ b/cmake/compiler_flags_override.cmake @@ -23,6 +23,14 @@ elseif ("x${CMAKE_${_lang}_COMPILER_ID}" STREQUAL "xMSVC") set(CMAKE_${_lang}_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1") set(CMAKE_${_lang}_FLAGS_RELEASE_INIT "/MT /O2 /Ob2") set(CMAKE_${_lang}_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1") + # Override linker flags (see Windows-MSVC.cmake for CMake's defaults) + # The stack size comes from the Python build system. + set(_msvc_stack_size "8388608") + set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /INCREMENTAL:NO /STACK:${_msvc_stack_size}") + set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /INCREMENTAL:NO /STACK:${_msvc_stack_size}") + set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO /STACK:${_msvc_stack_size}") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO /STACK:${_msvc_stack_size}") + unset(_msvc_stack_size) else() message(FATAL_ERROR "Overrides not set for ${_lang} compiler \"${CMAKE_${_lang}_COMPILER_ID}\"") endif()