Commit e9a0d146 authored by Robin Kastberg's avatar Robin Kastberg Committed by Fabio Baltieri
Browse files

toolchain: move some hardcoded flags to properties



Some basic flags that were hardcoded needed
to be moved to properties to be able to implement
alternative toolchains.

Signed-off-by: default avatarRobin Kastberg <robin.kastberg@iar.com>
parent d39d420c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2,7 +2,10 @@

# '-mcmse' enables the generation of code for the Secure state of the ARMv8-M
# Security Extensions. This option is required when building a Secure firmware.
zephyr_compile_options_ifdef(CONFIG_ARM_SECURE_FIRMWARE -mcmse)

zephyr_compile_options_ifdef(CONFIG_ARM_SECURE_FIRMWARE $<$<COMPILE_LANGUAGE:C>:$<TARGET_PROPERTY:compiler,cmse>>)
zephyr_compile_options_ifdef(CONFIG_ARM_SECURE_FIRMWARE $<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler,cmse>>)
zephyr_compile_options_ifdef(CONFIG_ARM_SECURE_FIRMWARE $<$<COMPILE_LANGUAGE:ASM>:$<TARGET_PROPERTY:asm,cmse>>)

if(CONFIG_ARM_FIRMWARE_HAS_SECURE_ENTRY_FUNCS)

+8 −0
Original line number Diff line number Diff line
@@ -125,6 +125,9 @@ set_property(TARGET compiler-cpp PROPERTY no_threadsafe_statics)
# Required ASM flags when compiling
set_property(TARGET asm PROPERTY required)

# GCC compiler flags for imacros. The specific header must be appended by user.
set_property(TARGET asm PROPERTY imacros)

# Compiler flag for disabling pointer arithmetic warnings
set_compiler_property(PROPERTY warning_no_pointer_arithmetic)

@@ -149,3 +152,8 @@ set_compiler_property(PROPERTY specs)

# Compiler flag for defining preinclude files.
set_compiler_property(PROPERTY include_file)

# Compiler flag for trustzone
set_compiler_property(PROPERTY cmse)

set_property(TARGET asm PROPERTY cmse)
+7 −0
Original line number Diff line number Diff line
@@ -231,6 +231,9 @@ set_property(TARGET compiler-cpp PROPERTY no_threadsafe_statics "-fno-threadsafe
# Required ASM flags when using gcc
set_property(TARGET asm PROPERTY required "-xassembler-with-cpp")

# GCC compiler flags for imacros. The specific header must be appended by user.
set_property(TARGET asm PROPERTY imacros "-imacros")

# gcc flag for colourful diagnostic messages
check_set_compiler_property(PROPERTY diagnostic -fdiagnostics-color=always)

@@ -253,3 +256,7 @@ set_compiler_property(PROPERTY no_builtin_malloc -fno-builtin-malloc)
set_compiler_property(PROPERTY specs -specs=)

set_compiler_property(PROPERTY include_file -include)

set_compiler_property(PROPERTY cmse -mcmse)

set_property(TARGET asm PROPERTY cmse -mcmse)