From 17d14e61cc33c0cff231c9d82557404d06fa704c Mon Sep 17 00:00:00 2001 From: jiriks74 Date: Tue, 24 Sep 2024 12:43:39 +0200 Subject: [PATCH] fix(CMake): Debugger flags were not set This caused optimization to be turned on for debug builds --- 01/CMakeLists.txt | 1 + 02/CMakeLists.txt | 1 + C_Template/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/01/CMakeLists.txt b/01/CMakeLists.txt index daf440b..da4a6b3 100644 --- a/01/CMakeLists.txt +++ b/01/CMakeLists.txt @@ -12,6 +12,7 @@ option(ENABLE_COVERAGE "Enable test coverage" ON) # Set C standard to C99 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") +set(CMAKE_C_FLAGS_DEBUG "-std=c99 -Wall -Wextra -Wunreachable-code -g -O0") # Set the project name and version number. This allows for a user of your project(${PROJECT_NAME} VERSION 0.1) diff --git a/02/CMakeLists.txt b/02/CMakeLists.txt index 2305156..618966d 100644 --- a/02/CMakeLists.txt +++ b/02/CMakeLists.txt @@ -12,6 +12,7 @@ option(ENABLE_COVERAGE "Enable test coverage" ON) # Set C standard to C99 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") +set(CMAKE_C_FLAGS_DEBUG "-std=c99 -Wall -Wextra -Wunreachable-code -g -O0") # Set the project name and version number. This allows for a user of your project(${PROJECT_NAME} VERSION 0.1) diff --git a/C_Template/CMakeLists.txt b/C_Template/CMakeLists.txt index 8837ebf..9d75eb2 100644 --- a/C_Template/CMakeLists.txt +++ b/C_Template/CMakeLists.txt @@ -12,6 +12,7 @@ option(ENABLE_COVERAGE "Enable test coverage" ON) # Set C standard to C99 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") +set(CMAKE_C_FLAGS_DEBUG "-std=c99 -Wall -Wextra -Wunreachable-code -g -O0") # Set the project name and version number. This allows for a user of your project(${PROJECT_NAME} VERSION 0.1)