zephyr/cmake/modules
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
..
FindBabbleSim.cmake
FindDeprecated.cmake cmake: python module cleanup. 2023-08-21 13:21:52 +02:00
FindDtc.cmake
FindGnuLd.cmake cmake: modules/FindGnuLd: cache variable GNULD_VERSION_STRING 2023-09-01 09:02:38 -04:00
FindHostTools.cmake cmake: modules: host tools: Bump minimum version to 0.16 2023-09-12 13:47:23 +02:00
FindLlvmLld.cmake cmake: Fix FindLlvmLld usage of unimported package 2023-06-26 12:40:03 +00:00
FindScaTools.cmake
FindTargetTools.cmake
FindZephyr-sdk.cmake
Findarmclang.cmake cmake: armclang version detection 2023-09-13 16:23:30 +02:00
FindoneApi.cmake cmake: Fix FindLlvmLld usage of unimported package 2023-06-26 12:40:03 +00:00
arch.cmake
basic_settings.cmake
boards.cmake cmake: modules: add support for board extensions 2023-08-21 16:28:22 +02:00
ccache.cmake
configuration_files.cmake cmake: modules: configuration_files: Force set app config dir 2023-09-01 17:44:59 +02:00
doc.cmake
dts.cmake cmake: modules: add support for board extensions 2023-08-21 16:28:22 +02:00
extensions.cmake cmake: extensions: Add zephyr_topological_sort() 2023-09-05 15:27:04 +02:00
generated_file_directories.cmake
kconfig.cmake cmake: expose TOOLCHAIN_HAS_PICOLIBC to kconfig 2023-09-13 17:36:46 -04:00
kernel.cmake cmake: warn the user that the toolchain cache hides errors 2023-09-22 13:42:21 +02:00
pre_dt.cmake
python.cmake cmake: python module cleanup. 2023-08-21 13:21:52 +02:00
root.cmake
shields.cmake
snippets.cmake
soc.cmake
unittest.cmake
user_cache.cmake
version.cmake cmake: version: Fix example comment 2023-09-01 17:44:28 +02:00
west.cmake cmake: cleanup old west version support 2023-08-24 10:47:00 +02:00
zephyr_default.cmake cmake: add ZephyrAppConfiguration package 2023-08-17 10:36:45 +02:00
zephyr_module.cmake