diff options
author | Petr Štetiar <ynezz@true.cz> | 2020-12-08 17:23:36 +0100 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2020-12-11 11:17:22 +0100 |
commit | a3c1a88b031afa077965378e119947a276e78e23 (patch) | |
tree | 51cd8a16146089df9a18dc76fd0956fc708ca028 | |
parent | 32ff717ed316e2d29563dcccfb272144dee9973c (diff) | |
download | uclient-a3c1a88b031afa077965378e119947a276e78e23.tar.gz |
cmake: enable extra compiler checks
Let's enforce additional automatic checks enforced by the compiler in
order to catch possible errors during compilation.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f0388ab..07796a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,12 @@ cmake_minimum_required(VERSION 2.6) INCLUDE(CheckIncludeFiles) PROJECT(uclient C) -ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations) +ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3) +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) SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") |