]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add build with debug symboles
authorBastian Dehn <hhaalo@arcor.de>
Sun, 14 Apr 2024 06:02:17 +0000 (08:02 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 14 Apr 2024 06:02:17 +0000 (08:02 +0200)
CMakeLists.txt
readme.md

index 5e512ec644cdd16c2f3fd38a2a1ce57c234de693..3f5204a0c48fe5f58eff32ab280607a0f978192c 100644 (file)
@@ -1,11 +1,18 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1)
 
-SET(CMAKE_C_COMPILER gcc CACHE STRING "compiler")
-IF (NOT RUN_TESTS)
-       SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "release" FORCE)
+SET(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "release")
+
+IF(CMAKE_BUILD_TYPE STREQUAL "RELEASE")
        SET(CMAKE_C_FLAGS "-Wall -Werror" CACHE STRING "compiler flags" FORCE)
-ELSE()
-       SET(CMAKE_BUILD_TYPE "DEBUG" CACHE STRING "release" FORCE)
+ENDIF()
+
+IF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+       SET(CMAKE_C_FLAGS "-Wall -g" CACHE STRING "debug compiler flags" FORCE)
+ENDIF()
+
+SET(CMAKE_C_COMPILER gcc CACHE STRING "compiler")
+IF (RUN_TESTS)
+       SET(CMAKE_BUILD_TYPE "DEBUG" CACHE STRING "debug" FORCE)
        SET(CMAKE_C_FLAGS "-fPIC \
 -fprofile-arcs \
 -ftest-coverage \
index d2d57c79a6f72dbb93e2e9b57fe0fbc83a958bd9..7a3c16fa44f6cbb1944c57e3683e35f8a51bf280 100644 (file)
--- a/readme.md
+++ b/readme.md
@@ -66,4 +66,11 @@ build with tests and run it
 ```bash
 cmake -DRUN_TESTS=on ..
 make
+```
+
+build with debug symboles
+
+```bash
+cmake -DCMAKE_BUILD_TYPE=DEBUG ..
+make
 ```
\ No newline at end of file