From f3e6bfdc590df220487cbb2144a01e36147df298 Mon Sep 17 00:00:00 2001 From: jpark37 Date: Tue, 3 Mar 2020 23:13:03 -0800 Subject: [PATCH] CMake: Disable incremental linking on Windows Not compatible with /OPT:REF, and caused warnings. --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f09aa784..5ea2c5fb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,9 +163,11 @@ if(MSVC) set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") endif() - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:REF") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /OPT:REF") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /OPT:REF") + foreach(t EXE SHARED MODULE) + set(CMAKE_${t}_LINKER_FLAGS "${CMAKE_${t}_LINKER_FLAGS} /OPT:REF") + set(CMAKE_${t}_LINKER_FLAGS_DEBUG "${CMAKE_${t}_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO") + set(CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO} /INCREMENTAL:NO") + endforeach() else() if(MINGW) set(CMAKE_WIDL "widl" CACHE STRING "wine IDL header file generation program")