diff --git a/CMakeLists.txt b/CMakeLists.txt index 314b81e2f3..c3ee37ea89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -772,12 +772,8 @@ include_directories( "${CMAKE_SOURCE_DIR}/src" ) -if(MSVC) - set(EXE_CFLAGS "-std=c++11") -else() - set(EXE_CFLAGS "-std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fno-exceptions -fno-rtti -Werror=strict-prototypes -Werror=old-style-definition -Werror=type-limits -Wno-missing-braces") -endif() - +# These have to go before the -Wno- flags +set(EXE_CFLAGS "-std=c++11") if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") if(MSVC) set(EXE_CFLAGS "${EXE_CFLAGS} /w") @@ -788,6 +784,12 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") endif() endif() +if(MSVC) + set(EXE_CFLAGS "${EXE_CFLAGS}") +else() + set(EXE_CFLAGS "${EXE_CFLAGS} -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fno-exceptions -fno-rtti -Werror=strict-prototypes -Werror=old-style-definition -Werror=type-limits -Wno-missing-braces") +endif() + set(EXE_LDFLAGS " ") if(MINGW)