diff --git a/CMakeLists.txt b/CMakeLists.txt index 2810a8520..79c527ad5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,8 +41,11 @@ set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "" FORCE) set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "" FORCE) set(CMAKE_VERBOSE OFF CACHE BOOL "Verbose mode") -if (MINGW) - set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG" CACHE STRING "") + +if (WIN32) + if(${CMAKE_GENERATOR} MATCHES "(MinGW)|(MSYS)") + set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG" CACHE STRING "") + endif() endif() if(CMAKE_VERBOSE)