From 9abdf2eec7e35669668ee9b2adec291a10bc5240 Mon Sep 17 00:00:00 2001 From: jpark37 Date: Tue, 3 Mar 2020 20:14:28 -0800 Subject: [PATCH] CMake: Enable /OPT:REF for Windows --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 304167886..2f09aa784 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,6 +162,10 @@ if(MSVC) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") 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") else() if(MINGW) set(CMAKE_WIDL "widl" CACHE STRING "wine IDL header file generation program")