Skip to content

Commit

Permalink
cmake: Toolchain abstraction: Abstract compiler flag for add debug info
Browse files Browse the repository at this point in the history
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 29, 2019
1 parent 4fffe79 commit e0569ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Expand Up @@ -226,8 +226,10 @@ toolchain_cc_freestanding()
# @Intent: Set compiler specific flag for tentative definitions, no-common # @Intent: Set compiler specific flag for tentative definitions, no-common
toolchain_cc_nocommon() toolchain_cc_nocommon()


# @Intent: Set compiler specific flag for production of debug information
toolchain_cc_produce_debug_info()

zephyr_compile_options( zephyr_compile_options(
-g # TODO: build configuration enough?
${TOOLCHAIN_C_FLAGS} ${TOOLCHAIN_C_FLAGS}
) )


Expand Down
6 changes: 6 additions & 0 deletions cmake/compiler/gcc/target_base.cmake
Expand Up @@ -7,6 +7,12 @@
# #
# See root CMakeLists.txt for description and expectations of this macro # 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) macro(toolchain_cc_nocommon)


zephyr_compile_options(-fno-common) zephyr_compile_options(-fno-common)
Expand Down

0 comments on commit e0569ac

Please sign in to comment.