zephyr/cmake
Ulf Magnusson 45050dda48 kconfig/cmake: Improve reconfiguration behavior
There are some issues with the behavior when rerunning CMake in an
already initialized build directory:

 1. The check for assignments to promptless symbols in configuration
    fragments isn't run when reconfiguring, because it only runs if
    zephyr/.config doesn't exist

 2. As outlined in
    https://github.com/zephyrproject-rtos/zephyr/issues/9573, you can
    get into situations where zephyr/.config is invalid (e.g. due to
    being outdated), but menuconfig/guiconfig can't be run to fix it

 3. If kconfig.py fails while merging fragments during reconfiguration,
    it will ignore the fragments during the next reconfiguration and use
    the existing zephyr/.config instead, because the fragment checksum
    is calculated and saved before running kconfig.py

(Footnote: The input configuration file(s) to kconfig.py can be either a
list of configuration fragments, when merging fragments, or just
zephyr/.config, if the merged configuration is up-to-date. The output
configuration file is always zephyr/.config.)

To fix the first two issues, explicitly tell kconfig.py when it's
dealing with handwritten configuration input (fragments), via a new
--handwritten-input-configs flag. This is more robust than checking
whether zephyr/.config exists, which was the old logic.

When dealing with handwritten input, there should be no assignments to
promptless symbols. Assignments to promptless symbols is expected in
zephyr/.config however, because it doubles as configuration output.

When running menuconfig/guiconfig, the input configuration is
zephyr/.config rather than configuration fragments, so this change also
makes sure that menuconfig can always be run as long as zephyr/.config
exists and is up-to-date.

To fix the last issue, only write the checksum for the configuration
fragments if kconfig.py succeeds (which means it wrote a
zephyr/.config).

Also improve naming a bit, add help texts for the command-line
parameters to kconfig.py, and simplify write_kconfig_filenames() by
moving logic into it.

Partial fix for
https://github.com/zephyrproject-rtos/zephyr/issues/9573, without the
part in #issuecomment-469701831. Can still run into issues when e.g.
when CMake files can't make sense of settings.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-22 18:28:07 +01:00
..
app cmake: app mem partion flexibility 2019-11-05 08:44:26 -08:00
backports cmake: Fixed a bug where python 3.8 was not detected on Windows 2019-11-04 14:32:41 +01:00
bintools cmake: Toolchain abstraction: Abstraction of binary tool, strip. 2019-08-02 13:05:59 +02:00
compiler cmake: toolchain: Fix 'host' toolchain variant 2020-01-07 13:25:47 -05:00
emu x86: intel64: Split 'locore' and 'main' kernel images for QEMU 2020-01-08 07:49:24 -06:00
flash cmake: Don't test whether the installed west is the bootstrapper 2019-11-05 17:43:50 +01:00
ide license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
linker/ld cmake: ld: use linker prefix for undefined symbols 2020-01-07 17:09:38 +01:00
reports cmake: allow appending dependencies to report targets 2020-01-20 18:35:01 -05:00
toolchain toolchain: xcc: use Clang if exists 2020-01-07 17:09:38 +01:00
usage cmake: Split out board listing from usage 2019-04-25 09:14:06 -07:00
util license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
boards.cmake cmake: Split out board listing from usage 2019-04-25 09:14:06 -07:00
ccache.cmake license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
cfb.cmake generated/cfb_font_dice.h: don't leak absolute paths in comment 2019-06-19 08:40:59 -04:00
dts.cmake dts: Rename generated_dts_board*.{h,conf} to devicetree*.{h,conf} 2020-01-17 17:57:59 +01:00
extensions.cmake doc: cmake: fixed 'strip_prefix' inconsistency 2020-01-16 11:29:46 +01:00
extra_flags.cmake cmake: extra_flags: fix EXTRA_CPPFLAGS being applied as macros 2019-12-13 13:23:40 -05:00
gcc-m-cpu.cmake arch: arm: Add Cortex-R5 support 2019-08-09 22:50:50 +02:00
generic_toolchain.cmake cmake: Toolchain abstraction: Abstraction of binary tools, foundation. 2019-07-31 11:09:35 +02:00
git.cmake cmake: explain BUILD_VERSION and KERNEL_VERSION_* 2019-05-09 11:52:05 +02:00
hex.cmake license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
host-tools.cmake cmake: -fmacro-prefix-map=${WEST_TOPDIR}=WEST_TOPDIR 2019-11-06 21:17:56 +01:00
kconfig.cmake kconfig/cmake: Improve reconfiguration behavior 2020-01-22 18:28:07 +01:00
kobj.cmake cmake: Fix missing dependency 2019-05-16 07:47:18 -05:00
pristine.cmake license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
python.cmake cmake: require python 3.6 or later 2019-12-18 10:15:45 +01:00
target_toolchain.cmake cmake: Toolchain abstraction: Abstraction of binary tools, foundation. 2019-07-31 11:09:35 +02:00
version.cmake cmake: print version to stdout, not stderr 2020-01-15 15:19:22 -05:00
zephyr_module.cmake cmake: zephyr_modules: Add west executable argument 2019-05-03 14:23:09 -04:00