Build: Eliminate duplicate debug flags for IAR
This patch only adds the debug flag for non debug builds. The IAR
tools are unreasonably picky with duplicate flags.
Signed-off-by: TTornblom <thomas.tornblom@iar.com>
Change-Id: I3e094c861fdb69cceeb364633edbeafb1b96abcb
diff --git a/toolchain_IARARM.cmake b/toolchain_IARARM.cmake
index 0984c8e..d9adcd2 100644
--- a/toolchain_IARARM.cmake
+++ b/toolchain_IARARM.cmake
@@ -48,8 +48,7 @@
$<$<COMPILE_LANGUAGE:C,CXX>:-DNO_TYPEOF>
$<$<COMPILE_LANGUAGE:C,CXX>:-D_NO_DEFINITIONS_IN_HEADER_FILES>
$<$<COMPILE_LANGUAGE:C,CXX>:--diag_suppress=Pe546,Pe940,Pa082,Pa084>
- $<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<BOOL:${TFM_DEBUG_SYMBOLS}>>:--debug>
- $<$<AND:$<COMPILE_LANGUAGE:ASM>,$<BOOL:${TFM_DEBUG_SYMBOLS}>>:-r>
+ $<$<AND:$<COMPILE_LANGUAGE:C,CXX,ASM>,$<BOOL:${TFM_DEBUG_SYMBOLS}>,$<CONFIG:Release,MinSizeRel>>:-r>
)
endmacro()