cmake: Toolchain abstraction: Abstract compiler flag for add debug info

The macro, toolchain_cc_produce_debug_info, adds the compiler specific
flag for enabling the production of debugging information in the
toolchain native format.

The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.

No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
This commit is contained in:
Danny Oerndrup 2019-07-23 09:00:55 +02:00 committed by Alberto Escolar
commit e0569ac2dc
2 changed files with 9 additions and 1 deletions

View file

@ -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}
)

View file

@ -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)