zephyr/cmake
Torsten Rasmussen 4cb2ef83bf cmake: kconfig: preserved quotes for Kconfig string values
Fixes: #48950

Kconfig requires quoted strings in its configuration files, like this:
> CONFIG_A_STRING="foo bar"

But CMake requires expects that strings are without additional qoutes,
and therefore qoutes are stripped when loading Kconfig config filers
into CMake.

This is particular important when the string in Kconfig is a path to a
file. In this case, not stripping the quotes leads to an error as the
file cannot be found.

When users pass a string to Kconfig through CMake, they are expected to
pass it so that qoutes are correct seen from Kconfig, that is:
> cmake -DCONFIG_A_STRING=\"foo bar\"

In CMake, those qoutes are written as-is to Kconfig extra config file,
and then removed in the CMake cache.
After Kconfig processing, the Kconfig settings are read back to CMake
but without quotes. Settings that was passed through the CMake cache,
for example using `-D` are written back to the cache, but this time
without the qoutes. This results in Kconfig errors on sub-sequent CMake
runs.

Instead of writing the Kconfig value setting back to the CMake cache,
introduce an internal shadow symbol in the cache prefixed with `CLI_`.
This allows the CMake cache to keep the value correctly formatted for
Kconfig extra config creation, while at the same time keep existing
behavior for CONFIG_ symbols read from Kconfig.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-08-25 17:53:11 -07:00
..
app
bintools cmake/llvm: Improve tool detection 2022-08-19 08:30:01 +02:00
compiler xcc-clang: Do not used unavailable options 2022-08-23 10:13:43 +02:00
emu
flash npcx: Set hex_file automatically w/ npcx hex image 2022-06-28 11:09:35 +02:00
ide
linker arch/riscv: support CONFIG_CODE_DATA_RELOCATION 2022-08-24 10:08:06 +02:00
linker_script cmake: Fix typo in common-rom.cmake 2022-08-17 15:47:52 +00:00
makefile_exports
modules cmake: kconfig: preserved quotes for Kconfig string values 2022-08-25 17:53:11 -07:00
reports
toolchain soc: xtensa: esp32_net: update kconfig 2022-08-16 18:06:02 +02:00
usage
util
cfb.cmake scripts: move gen_cfb_font_header.py to scripts/build 2022-07-12 10:03:45 +02:00
extra_flags.cmake
gcc-m-cpu.cmake arch: arm64: define A55 core 2022-06-29 10:27:19 +02:00
gcc-m-fpu.cmake cmake: allow Cortex-R52 to configure VFP 2022-07-26 08:48:07 +02:00
gen_version_h.cmake
hex.cmake
kobj.cmake scripts: move gen_kobject_list.py to scripts/build/gen_kobject_list.py 2022-07-12 10:03:45 +02:00
mcuboot.cmake
package_helper.cmake cmake: Update cmake_minimum_required to 3.20.0 2022-07-04 10:18:45 +02:00
pristine.cmake
target_toolchain_flags.cmake