zephyr/cmake/modules
Torsten Rasmussen b066ae906b cmake: fix improper use of separate_arguments
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>
2022-09-05 10:22:05 +02:00
..
arch.cmake cmake: kconfig: introduce dedicated unit testing board 2022-08-18 14:29:14 +02:00
basic_settings.cmake cmake: extend zephyr_get() to handle build configurations from sysbuild 2022-09-02 15:16:50 +02:00
boards.cmake cmake: update common Zephyr build settings to use zephyr_get() 2022-09-02 15:16:50 +02:00
ccache.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
configuration_files.cmake cmake: extend zephyr_get() to handle build configurations from sysbuild 2022-09-02 15:16:50 +02:00
doc.cmake cmake: doc: created a doc.cmake CMake module in Zephyr CMake modules dir 2022-02-22 10:02:39 -08:00
dts.cmake cmake: rework of host tools and generic toolchain handling 2022-09-01 15:59:43 +02:00
extensions.cmake cmake: extend zephyr_get() to handle build configurations from sysbuild 2022-09-02 15:16:50 +02:00
FindDeprecated.cmake cmake: use zephyr_get in toolchains to ensure identical behavior. 2022-09-02 15:16:50 +02:00
FindDtc.cmake cmake: cleanup search for devicetree compiler, dtc 2022-09-01 15:59:43 +02:00
FindHostTools.cmake cmake: locate Zephyr SDK before locating other host tools. 2022-09-02 19:41:15 +09:00
FindTargetTools.cmake cmake: rework of target toolchain handling 2022-09-01 15:59:43 +02:00
FindZephyr-sdk.cmake cmake: use zephyr_get in toolchains to ensure identical behavior. 2022-09-02 15:16:50 +02:00
kconfig.cmake cmake: extend zephyr_get() to handle build configurations from sysbuild 2022-09-02 15:16:50 +02:00
kernel.cmake cmake: rework of target toolchain handling 2022-09-01 15:59:43 +02:00
python.cmake cmake: Bump the minimum required Python version to 3.8 2022-08-24 18:35:57 +02:00
root.cmake cmake: kconfig: introduce dedicated unit testing board 2022-08-18 14:29:14 +02:00
shields.cmake devicetree: drop support for dts_fixup.h files 2022-08-11 12:17:02 +02:00
soc.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
unittest.cmake cmake: fix improper use of separate_arguments 2022-09-05 10:22:05 +02:00
user_cache.cmake scripts: move dir_is_writeable.py to scripts/build 2022-07-12 10:03:45 +02:00
version.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
west.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
zephyr_default.cmake cmake: extend zephyr_get() to handle build configurations from sysbuild 2022-09-02 15:16:50 +02:00
zephyr_module.cmake cmake: update common Zephyr build settings to use zephyr_get() 2022-09-02 15:16:50 +02:00