From: Hans Dedecker Date: Sat, 3 Apr 2021 18:28:11 +0000 (+0200) Subject: cmake: enable extra compiler checks X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e0d9a4b2c7b177588fa6dc812031840777692740;p=project%2Fodhcp6c.git cmake: enable extra compiler checks Let's catch enforced compiler errors during compilation Signed-off-by: Hans Dedecker --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a5b0cb3..94f279c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,13 @@ cmake_policy(SET CMP0015 NEW) # Project Definition project(odhcp6c C) set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c99") -add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra -pedantic) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3 -std=c99") +add_definitions(-D_GNU_SOURCE -Os -Wall -Werror -pedantic) +IF(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6) + add_definitions(-Wextra -Werror=implicit-function-declaration) + add_definitions(-Wformat -Werror=format-security -Werror=format-nonliteral) +ENDIF() +add_definitions(-Wno-unused-parameter -Wmissing-declarations) if(${EXT_PREFIX_CLASS}) add_definitions(-DEXT_PREFIX_CLASS=${EXT_PREFIX_CLASS})