diff --git a/CMakeLists.txt b/CMakeLists.txt index db642e9fc36..a145738a6c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,8 +226,10 @@ toolchain_cc_freestanding() # @Intent: Set compiler specific flag for tentative definitions, no-common toolchain_cc_nocommon() +# @Intent: Set compiler specific flag for production of debug information +toolchain_cc_produce_debug_info() + zephyr_compile_options( - -g # TODO: build configuration enough? ${TOOLCHAIN_C_FLAGS} ) diff --git a/cmake/compiler/gcc/target_base.cmake b/cmake/compiler/gcc/target_base.cmake index b8f834ce491..a180962697b 100644 --- a/cmake/compiler/gcc/target_base.cmake +++ b/cmake/compiler/gcc/target_base.cmake @@ -7,6 +7,12 @@ # # See root CMakeLists.txt for description and expectations of this macro +macro(toolchain_cc_produce_debug_info) + + zephyr_compile_options(-g) # TODO: build configuration enough? + +endmacro() + macro(toolchain_cc_nocommon) zephyr_compile_options(-fno-common)