toolchain: compiler: IAR does not allow vla with C++

Fixed a problem where the command line option --vla was used
with C++ causing a command line error in the IAR ICCARM compiler.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
This commit is contained in:
Lars-Ove Karlsson 2025-07-01 15:01:06 +02:00 committed by Dan Kalowsky
parent 970c715ef4
commit 2a9be50c29

View File

@ -86,7 +86,7 @@ endif()
# Enable VLA if CONFIG_MISRA_SANE is not set and warnings are not enabled.
if(NOT CONFIG_MISRA_SANE AND NOT DEFINED W)
list(APPEND IAR_COMMON_FLAGS --vla)
list(APPEND IAR_COMMON_FLAGS $<$<COMPILE_LANGUAGE:C>:--vla>)
endif()
# Minimal ASM compiler flags