[CMAKE/MSVC] Enable function level linking and comdat folding independent from build...
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 28 Mar 2016 16:38:26 +0000 (16:38 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 28 Mar 2016 16:38:26 +0000 (16:38 +0000)
svn path=/trunk/; revision=71066

reactos/cmake/msvc.cmake

index a6610e2..e086ffb 100644 (file)
@@ -6,7 +6,6 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
 elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
     add_compile_flags("/Ox /Ob2 /Ot /Oy /GT /GF")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:REF /OPT:ICF")
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /OPT:REF /OPT:ICF")
 elseif(OPTIMIZE STREQUAL "1")
     add_definitions(/O1)
 elseif(OPTIMIZE STREQUAL "2")
@@ -19,6 +18,11 @@ elseif(OPTIMIZE STREQUAL "5")
     add_definitions(/GF /Gy /Ob2 /Os /Ox /GS-)
 endif()
 
+# Enable function level linking and comdat folding
+add_compile_flags("/Gy")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /OPT:REF /OPT:ICF")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:REF /OPT:ICF")
+
 if(ARCH STREQUAL "i386")
     add_definitions(/DWIN32 /D_WINDOWS)
 endif()