From 8fad7490ad5b234a8e28c1eb38e6b2c2257c1822 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 22 Dec 2009 19:02:52 +0000 Subject: [PATCH] Improvement to add /analyze only on WIN32. --- CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ebe952d..20568b9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,13 @@ INCLUDE(${cmake_dir}/CMakeLists_launcher.txt) # Setup the CPack config. INCLUDE(${cmake_dir}/CMakeLists_cpack.txt) -# add /analyze in order to unconver potential bugs in the source code -# Details: http://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /analyze") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /analyze") +IF(WIN32) + # add /analyze in order to unconver potential bugs in the source code + # Details: http://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /analyze") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /analyze") + +ENDIF(WIN32) + +# this line removes "/D NDEBUG" from release, we want them in order to find bugs even on release builds. +SET(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /Ob2")