Commit 92a6898b authored by Aurelien Jarno's avatar Aurelien Jarno Committed by Anas Nashif
Browse files

cmake: allow multiple compiler options



It is currently not possible to define multiple compiler options using
the CONFIG_COMPILER_OPT Kconfig option. The string is interpreted as a
single quoted option, for example "-opt1 -opt2".

This patch fixes that by splitting the CONFIG_COMPILER_OPT string into
multiple options using the separate_arguments cmake function.

Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
parent 5bfc7ff2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -222,7 +222,8 @@ if(CONFIG_OVERRIDE_FRAME_POINTER_DEFAULT)
  endif()
endif()

zephyr_compile_options(${CONFIG_COMPILER_OPT})
separate_arguments(CONFIG_COMPILER_OPT_AS_LIST UNIX_COMMAND ${CONFIG_COMPILER_OPT})
zephyr_compile_options(${CONFIG_COMPILER_OPT_AS_LIST})

# TODO: Include arch compiler options at this point.