diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3780e31b2..c1f446cb1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -773,7 +773,9 @@ else() endif() if(MINGW) - set(OTHER_FLAGS "${OTHER_FLAGS} -mthreads -fexceptions") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(OTHER_FLAGS "${OTHER_FLAGS} -mthreads") + endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0601 -DWIN32_LEAN_AND_MEAN") endif() @@ -813,7 +815,7 @@ else() endif() if(MINGW) - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mwindows") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-mwindows") endif() endif()