diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb17572..9842932 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,26 +46,25 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
 		message(FATAL_ERROR "Visual Studio 2015 or higher required")
 	endif()
 
+	
+	# DEBUG compiler flags:
+	#	/Zi create debugging information PDB file
+	#	/Od disable optimizations
+	# 	/Oy- do not suppress frame pointers (recommended for debugging)
+	#	/MTd use statically linked, thread-safe, debug CRT libs (Magic Builder set this flag when build)
+	#
+	# RELEASE compiler flags:
+	#	/MT use statically linked, thread-safe CRT libs (Magic Builder set this flag when build)
+	# 	/GS- no Buffer Security Check
+	#
+	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zi /Od /Oy-")
+	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
+
+	# Explaining of linker flags and why enable pdb with debug info for Release build is on:
+	#  https://www.wintellect.com/correctly-creating-native-c-release-build-pdbs
+	set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
 endif()
 
-# DEBUG compiler flags:
-#	/Zi create debugging information PDB file
-#	/Od disable optimizations
-# 	/Oy- do not suppress frame pointers (recommended for debugging)
-#	/MTd use statically linked, thread-safe, debug CRT libs (Magic Builder set this flag when build)
-#
-# RELEASE compiler flags:
-#	/MT use statically linked, thread-safe CRT libs (Magic Builder set this flag when build)
-# 	/GS- no Buffer Security Check
-#
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zi /Od /Oy-")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
-
-# Explaining of linker flags and why enable pdb with debug info for Release build is on:
-#  https://www.wintellect.com/correctly-creating-native-c-release-build-pdbs
-set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASEz} /DEBUG /OPT:REF /OPT:ICF")
-
-
 subdirs(src conf man files)
 if(WITH_LUA)
     add_subdirectory(lua)