zephyr/cmake/modules
Marc Herbert acb7f71ae5 cmake: sparse: fix handling of (deprecated) -DSPARSE=garbage
Due to many layers of indirections (Github Actions, Docker scripts, SOF
build scripts, etc.), thesofproject/sof/pull/7452's first attempt to
turn off VLAs ended up setting `-DSPARSE=gar bage`:

  west build ...  -- '-DSPARSE=y -DCONFIG_LOG_USE_VLA=n'

Quoting issues are typical when trying to pass parameters through too
many layers of indirections. In this case, the mistake set the $SPARSE
variable to the 'y -DCONFIG_LOG_USE_VLA=n' garbage which printed this
confusing and time-consuming error message:

    Setting SPARSE=y -DCONFIG_LOG_USE_VLA=n is deprecated.

Worse: this enabled sparse (!) while silently ignoring the garbage
trailing after "y".

1. Enable sparse only when $SPARSE is equal to "y" and nothing
   else. This stops enabling sparse when `-DSPARSE=gar bage` which draws
   more attention to the warning and gives a little more incentive to
   leave the deprecated option behind. Don't make any difference between
   the "n" and "gar bage" values because $SPARSE is deprecated so not
   worth that much CMake code.

2. Add quotes in the deprecation message to make garbage values more
   obvious, now:

    Setting SPARSE='y -DCONFIG_LOG_USE_VLA=n' is deprecated.

Fixes: 60196ca112 ("cmake: sparse: deprecate old sparse support")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-20 10:49:23 +02:00
..
arch.cmake cmake: kconfig: introduce dedicated unit testing board 2022-08-18 14:29:14 +02:00
basic_settings.cmake cmake: extend zephyr_get() to handle build configurations from sysbuild 2022-09-02 15:16:50 +02:00
boards.cmake cmake: fix and clean up some module doc comments 2023-01-11 09:40:14 +01:00
ccache.cmake
configuration_files.cmake cmake: Change prj_<board>.conf deprecation location 2023-03-22 08:58:14 +00:00
doc.cmake
dts.cmake cmake: modules: dts: extract preprocessing helper extension 2023-04-12 13:04:31 +02:00
extensions.cmake cmake: Add zephyr_libc_link_libraries function 2023-04-17 11:13:17 +02:00
Findarmclang.cmake armclang: Add version check for armclang toolchain 2023-02-28 13:54:56 +01:00
FindDeprecated.cmake cmake: sparse: fix handling of (deprecated) -DSPARSE=garbage 2023-04-20 10:49:23 +02:00
FindDtc.cmake cmake: cleanup search for devicetree compiler, dtc 2022-09-01 15:59:43 +02:00
FindGnuLd.cmake cmake: toolchain: cache property GNULD_LINKER_IS_BFD 2023-04-12 10:25:41 -04:00
FindHostTools.cmake unittest: update coverage library non gcc toolchains 2022-11-21 16:09:46 -05:00
FindLlvmLld.cmake linker: lld: see if clang has a preferred linker 2023-03-29 19:48:47 -04:00
FindoneApi.cmake toolchain: oneApi: Fix support and update for 2023.0.0 release 2023-02-23 14:30:03 -05:00
FindScaTools.cmake cmake: implement build infrastructure for supporting SCA tools. 2023-01-27 20:28:58 +09:00
FindTargetTools.cmake cmake: propagate endianess to CMake CMAKE_<lang>_BYTE_ORDER setting 2022-09-26 15:09:38 +00:00
FindZephyr-sdk.cmake cmake: FindZephyr-sdk: Find newest SDK version 2023-03-06 13:51:36 +01:00
generated_file_directories.cmake cmake: modules: add generated_file_directories 2023-04-12 13:04:31 +02:00
kconfig.cmake cmake: BOARD_REVISION_CONFIG setting for Kconfig revision fragments 2023-01-11 08:10:45 -08:00
kernel.cmake cmake: implement build infrastructure for supporting SCA tools. 2023-01-27 20:28:58 +09:00
pre_dt.cmake cmake: modules: dts: extract preprocessing helper extension 2023-04-12 13:04:31 +02:00
python.cmake cmake: Bump the minimum required Python version to 3.8 2022-08-24 18:35:57 +02:00
root.cmake cmake: implement build infrastructure for supporting SCA tools. 2023-01-27 20:28:58 +09:00
shields.cmake cmake: fix and clean up some module doc comments 2023-01-11 09:40:14 +01:00
snippets.cmake snippets: initial snippet.yml support 2023-03-26 16:12:41 +02:00
soc.cmake
unittest.cmake unittest: add support for coverage 2022-11-28 16:26:02 -05:00
user_cache.cmake scripts: move dir_is_writeable.py to scripts/build 2022-07-12 10:03:45 +02:00
version.cmake cmake: add CMake configure dependency for VERSION file 2023-04-04 17:27:38 +02:00
west.cmake cmake: modules: west: allow custom MIN_WEST_VERSION 2023-03-08 14:16:53 -08:00
zephyr_default.cmake cmake: modules: add generated_file_directories 2023-04-12 13:04:31 +02:00
zephyr_module.cmake cmake: modules: Make modules.cmake check more precise 2023-03-27 22:15:59 +00:00