diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2021-04-03 20:54:57 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2021-04-03 21:13:26 +0200 |
commit | ebd4297fc8317a426a6c0faea1cbba2e523270d4 (patch) | |
tree | ffcc3d2ef3479b1de275b17c3d6d4ab37fdab5b4 /CMakeLists.txt | |
parent | 405da325b57e6793469964ee9a3bfe66df11d4ab (diff) |
cmake: enforce additonal compiler checks
Let's catch compile errors by enabling extra compiler checks
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c3e0ae..828fa71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_policy(SET CMP0015 NEW) project(odhcpd C) set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=gnu99") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3 -std=gnu99") FIND_PATH(ubox_include_dir libubox/uloop.h) FIND_PATH(libnl-tiny_include_dir netlink-generic.h PATH_SUFFIXES libnl-tiny) @@ -13,7 +13,13 @@ INCLUDE_DIRECTORIES(${ubox_include_dir} ${libnl-tiny_include_dir}) FIND_LIBRARY(libnl NAMES nl-tiny) -add_definitions(-D_GNU_SOURCE --std=gnu99 -Wall -Werror -Wextra -Wmissing-declarations -Wno-unused-parameter) +add_definitions(-D_GNU_SOURCE -Os -Wall -Werror --std=gnu99) +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_CER_ID}) add_definitions(-DEXT_CER_ID=${EXT_CER_ID}) |