cmake: Fix compilation options for kobject_hash*.c

Rework how the compilation-options for the gperf generated
kobject_hash*.c files are put together to fix problems with SHELL:
and cmake-list separators handling.

zephyr_get_compile_options_for_lang_as_string() returns the set of
options as a cmake generator expression string which is cumbersome to
edit. This caused the command line for the IAR toolchain to have broken
SHELL: entries, and other some command line entries being postfixed by
"gnu".

This also adds CMake compiler properties for no_function_sections and
no_data_sections options

Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
This commit is contained in:
Björn Bergman 2024-12-18 13:57:52 +01:00 committed by Anas Nashif
commit bb797ab421
4 changed files with 39 additions and 10 deletions

View file

@ -266,3 +266,9 @@ set_compiler_property(PROPERTY include_file -include)
set_compiler_property(PROPERTY cmse -mcmse)
set_property(TARGET asm PROPERTY cmse -mcmse)
# Compiler flag for not placing functions in their own sections:
set_compiler_property(PROPERTY no_function_sections "-fno-function-sections")
# Compiler flag for not placing variables in their own sections:
set_compiler_property(PROPERTY no_data_sections "-fno-data-sections")