diff options
author | sfan5 <sfan5@live.de> | 2022-04-28 20:26:54 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-04-30 16:49:41 +0200 |
commit | faecff570c48350c599bcf043a7004a52ddf1b39 (patch) | |
tree | dbb8616f696bb81c52f38fcc56eac122a3d58030 /src | |
parent | 828461c193c9dcee1221a367b340084e4ee643ad (diff) | |
download | minetest-faecff570c48350c599bcf043a7004a52ddf1b39.tar.gz minetest-faecff570c48350c599bcf043a7004a52ddf1b39.tar.bz2 minetest-faecff570c48350c599bcf043a7004a52ddf1b39.zip |
Enable additional warning flags
also make them work with the RelWithDebInfo build type
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0323603fc..f9ec419e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -693,14 +693,13 @@ if(MSVC) endif() else() # GCC or compatible compilers such as Clang + set(WARNING_FLAGS "-Wall -Wextra") + set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-unused-parameter -Wno-implicit-fallthrough") if(WARN_ALL) - set(RELEASE_WARNING_FLAGS "-Wall") + set(RELEASE_WARNING_FLAGS "${WARNING_FLAGS}") else() set(RELEASE_WARNING_FLAGS "") endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang") - set(WARNING_FLAGS "${WARNING_FLAGS} -Wsign-compare") - endif() if(APPLE AND USE_LUAJIT) # required per http://luajit.org/install.html @@ -742,7 +741,7 @@ else() endif() endif() - set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} ${OTHER_FLAGS} -Wall -pipe -funroll-loops") + set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${OTHER_FLAGS} -pipe -funroll-loops") if(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os") else() @@ -755,8 +754,9 @@ else() set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MATH_FLAGS}") endif() endif() - set(CMAKE_CXX_FLAGS_SEMIDEBUG "-g -O1 -Wall ${WARNING_FLAGS} ${OTHER_FLAGS}") - set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall ${WARNING_FLAGS} ${OTHER_FLAGS}") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -g") + set(CMAKE_CXX_FLAGS_SEMIDEBUG "-g -O1 ${WARNING_FLAGS} ${OTHER_FLAGS}") + set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 ${WARNING_FLAGS} ${OTHER_FLAGS}") if(USE_GPROF) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg") |