b066ae906b
The use of `separate_arguments()` in extra_flags.cmake and unittest.cmake prevents the use of proper CMake lists. A CMake list can be specified on command line as: `-DMY_LIST="itemA;itemB;itemC"` Users are expected to be able to provide extra compile flags using CMake lists, like `-DEXTRA_CFLAGS="--flag1;--flag2"` but also using space separated lists, like: `-DEXTRA_CFLAGS="--flag1 --flag2"`. However, the way FLAGS was passed to separate_arguments() would result in a list being treated as extra arguments to the function and thus result in a CMake error. To allow the use of CMake lists, the length of the argument as a CMake list is tested. This ensures that when the argument contains a single `;` then the length is >1 and no conversion is needed. This allows a user to freely choose between the two forms: - `-DFLAGS="--flag1 --flag2"` - `-DFLAGS="--flag1;--flag2"` or when passing flags which themselves contains spaces, like: - `-DFLAGS="--flag1 \"val1 val2\""` - `-DFLAGS="--flag1;val1 val2"` Note that the extra escaped qouting is no longer needed for proper CMake lists as the `;` itself informs the system that spaces are to be kept as spaces. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no> |
||
---|---|---|
.. | ||
arch.cmake | ||
basic_settings.cmake | ||
boards.cmake | ||
ccache.cmake | ||
configuration_files.cmake | ||
doc.cmake | ||
dts.cmake | ||
extensions.cmake | ||
FindDeprecated.cmake | ||
FindDtc.cmake | ||
FindHostTools.cmake | ||
FindTargetTools.cmake | ||
FindZephyr-sdk.cmake | ||
kconfig.cmake | ||
kernel.cmake | ||
python.cmake | ||
root.cmake | ||
shields.cmake | ||
soc.cmake | ||
unittest.cmake | ||
user_cache.cmake | ||
version.cmake | ||
west.cmake | ||
zephyr_default.cmake | ||
zephyr_module.cmake |