diff --git a/CMakeLists.txt b/CMakeLists.txt index bcf598406..1f01702e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,14 +108,14 @@ endif() if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") message("-- Compiler is Clang/LLVM") execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION) - if(CLANG_VERSION VERSION_LESS 4.2.1) - message(SEND_ERROR "You need at least Clang 4.2.1 to compile EmulationStation-DE") + if(CLANG_VERSION VERSION_LESS 5.0.0) + message(SEND_ERROR "You need at least Clang 5.0.0 to compile EmulationStation-DE") endif() elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") message("-- Compiler is GNU/GCC") execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpfullversion OUTPUT_VARIABLE G++_VERSION) - if(G++_VERSION VERSION_LESS 5.4) - message(SEND_ERROR "You need at least GCC 5.4 to compile EmulationStation-DE") + if(G++_VERSION VERSION_LESS 7.1) + message(SEND_ERROR "You need at least GCC 7.1 to compile EmulationStation-DE") endif() if(WIN32) set(CMAKE_CXX_FLAGS "-mwindows ${CMAKE_CXX_FLAGS}") @@ -136,7 +136,7 @@ if(CMAKE_BUILD_TYPE MATCHES Debug) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /Od /DEBUG:FULL") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O0 -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O0") endif() # If using Clang, then add additional debug data needed by GDB. @@ -151,7 +151,7 @@ elseif(CMAKE_BUILD_TYPE MATCHES Profiling) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /O2 /DEBUG:FULL") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -pg -g") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -pg -g -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O2 -pg") endif() else() @@ -160,7 +160,7 @@ else() if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG /std:c++17 /O2 /DEBUG:NONE") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -DNDEBUG") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -DNDEBUG -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers") if(APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O2") else()