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
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
ide
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
modules cmake: warn the user that the toolchain cache hides errors 2023-09-22 13:42:21 +02:00
reports
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
util
cfb.cmake
extra_flags.cmake
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
gen_version_h.cmake
hex.cmake
kobj.cmake
mcuboot.cmake cmake: add Zephyr image output files as byproducts 2023-08-22 12:31:43 +02:00
package_helper.cmake
pristine.cmake
target_toolchain_flags.cmake
verify-toolchain.cmake
vif.cmake