Skip to content
Permalink
Browse files

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>
  • Loading branch information...
daor-oti authored and aescolar committed Jul 23, 2019
1 parent 4fffe79 commit e0569ac2dc9162834485f1f95f59919b7511ea3a
Showing with 9 additions and 1 deletion.
  1. +3 −1 CMakeLists.txt
  2. +6 −0 cmake/compiler/gcc/target_base.cmake
@@ -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}
)

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

0 comments on commit e0569ac

Please sign in to comment.
You can’t perform that action at this time.