Add Cmake variable for Uart on debug header in release and use -Og for debugbuild instead of -O0

This commit is contained in:
Mario Hüttel 2021-04-06 19:25:25 +02:00
parent 6ebd74cb31
commit 533656ca28
2 changed files with 7 additions and 2 deletions

View File

@ -15,3 +15,4 @@ reflow-controller.includes
*.config *.config
*.files *.files
*.user.* *.user.*
*.user

View File

@ -49,13 +49,17 @@ message("${BoldGreen}Version: ${GIT_DESCRIBE}${ColorReset}")
IF(CMAKE_BUILD_TYPE STREQUAL "Debug") IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUGBUILD) add_definitions(-DDEBUGBUILD)
add_compile_options(-O0 -g) add_compile_options(-Og -g)
ELSE() ELSE()
add_definitions(-DDEBUGBUILD)
add_compile_options(-O3 -g) add_compile_options(-O3 -g)
add_link_options(-Wl,--gc-sections) add_link_options(-Wl,--gc-sections)
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
if (DEFINED UART_ON_DEBUG_HEADER)
add_definitions(-DUART_ON_DEBUG_HEADER)
endif (DEFINED UART_ON_DEBUG_HEADER)
add_subdirectory(base64-lib) add_subdirectory(base64-lib)