zephyr/cmake
Marc Herbert 4cba9e6d42 cmake: warn the user that the toolchain cache hides errors
When `toolchain_is_ok` fails, the error message points the user at the
CMake logs. But those logs will be empty if the user tried to compile
more than once (typically: cleans everything and tries again). So tell
the user that cleaning the toolchain cache is required to see the error.

Tell the user to "move" the cache instead of removing it in case
technical support needs the cache for forensics.

Some finicky toolchains can be "non-deterministic" and fail
_sometimes_. For instance a license server can be flaky, or the
toolchain can require an "elaborate" set of environment variables
triggering some configuration "trial-and-error". In such a
non-deterministic case deleting the cache is enough to get rid of the
issue and move on! Looking at logs is not even required; even
better. Once the toolchain cache believes that the toolchain works, any
future toolchain glitch will be obvious at actual compilation time.

To test all this:
```
 # Verify that the toolchain can compile a dummy file, if it is not we
 # won't be able to test for compatibility with certain C flags.
-zephyr_check_compiler_flag(C "" toolchain_is_ok)
+zephyr_check_compiler_flag(C "-fubar" toolchain_is_ok)
 assert(toolchain_is_ok "The toolchain is unable to build a dummy C file.\
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-09-22 13:42:21 +02:00
..
app cmake: function to update Zephyr_DIR when loading old Zephyr packages 2022-03-07 16:35:54 +01:00
bintools ARC: MWDT: rework GNU helper tools usage 2023-06-17 07:44:31 -04:00
compiler cmake/toolchain: Support LLVM source profiling/coverage for native boards 2023-08-28 10:35:21 +02:00
emu twister: add support for custom emulator in simulator 2023-08-02 17:35:26 +02:00
flash west: runners: uf2: Add new UF2 runner. 2023-02-20 12:50:38 +01:00
ide license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
linker cmake: armlink: update CMake library to arch__arm__core__cortex_m 2023-09-13 14:37:08 +01:00
linker_script zbus: improve the way of storing observers 2023-08-29 10:18:55 +02:00
makefile_exports cmake: using zephyr_get_compile_options_for_lang_as_string for export 2020-12-15 08:37:54 -05:00
modules cmake: warn the user that the toolchain cache hides errors 2023-09-22 13:42:21 +02:00
reports scripts: size_report: Add support for TF-M and BL2 image size reports 2022-03-09 14:03:52 -05:00
sca cmake: sca: codechecker: Support storing results 2023-08-23 14:45:03 +02:00
toolchain Revert "llvm: use proper syntax for --config option" 2023-08-31 10:24:29 +02:00
usage cmake: boards and shields cmake files repurposed 2022-02-22 10:02:39 -08:00
util license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
cfb.cmake scripts: move gen_cfb_font_header.py to scripts/build 2022-07-12 10:03:45 +02:00
extra_flags.cmake cmake: fix improper use of separate_arguments 2022-09-05 10:22:05 +02:00
gcc-m-cpu.cmake soc: arm64: Add agilex5 soc folder and its configurations 2023-07-25 16:58:01 +00:00
gcc-m-fpu.cmake cmake: gcc: Fix Cortex-R52 FPU type 2022-10-19 00:28:33 +09:00
gen_version_h.cmake cmake: generalize VERSION infrastructure for better reuse 2023-05-17 13:56:58 +02:00
hex.cmake license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
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 cmake: add Zephyr image output files as byproducts 2023-08-22 12:31:43 +02:00
package_helper.cmake cmake: update package helper description to use EXTRA_CONF_FILE var 2023-05-23 16:40:21 +02:00
pristine.cmake cmake: pristine.cmake requires SOURCE_DIR and BINARY_DIR as arguments 2021-01-23 08:31:13 -05:00
target_toolchain_flags.cmake everywhere: fix typos 2022-03-14 20:22:24 -04:00
verify-toolchain.cmake cmake: rework of host tools and generic toolchain handling 2022-09-01 15:59:43 +02:00
vif.cmake USB-C: genVIF: Cleanup and add support to pick static data from input 2023-05-26 13:54:43 -04:00