From: Bastian Dehn Date: Tue, 12 Mar 2024 17:14:25 +0000 (+0100) Subject: add compiler flacs for code coverage X-Git-Tag: v1.0.0^2~105 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=a577213331ec1ead4853c0f95b0785d86c46a172;p=sane-kds-s2000w-net.git add compiler flacs for code coverage --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fef4a2..9839067 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,13 @@ cmake_minimum_required(VERSION 3.25.1) set(CMAKE_C_COMPILER gcc CACHE STRING "compiler") -set(CMAKE_C_FLAGS "-Wall" CACHE STRING "compiler flags") +if (NOT RUN_TESTS) + set(CMAKE_C_FLAGS "-Wall -Werror" CACHE STRING "compiler flags") +else() + set(CMAKE_C_FLAGS "-fPIC -fprofile-arcs -ftest-coverage -Wall -Werror" CACHE STRING "test coverage compiler flags") +endif() + +message(STATUS "CMAKE_C_FLAGS " ${CMAKE_C_FLAGS}) project("kds_s2000w_net" VERSION "0.0.1")