Skip to content
Commit 8460d91e authored by Torsten Rasmussen's avatar Torsten Rasmussen Committed by Carles Cufí
Browse files

cmake: extend zephyr_get() to support fetching of multiple variables



This commit extends zephyr_get() to support multiple variable names to
be fetched into a single variable.

Example:
  zephyr_get(FOO VAR FOO_A FOO_B FOO_C)

will lookup each FOO_A, FOO_B, FOO_C for supported scopes and return
the value in FOO of the first scope encountered having one of the
variables defined.

If MERGE is specified, then all scopes for all vars are looped and the
variable values are merged into FOO and returned.

This functionality will allow to deprecate user-facing settings while
ensuring that both the new and deprecated variables are considered
in zephyr_get() and also taking into consideration the scope with
highest precedence.

This allows Zephyr CMake to do:
  zephyr_get(FOO VAR FOO DEPRECATED_FOO)

  zephyr_get(BAR MERGE VAR BAR DEPRECATED_BAR)

This allows support of old and new setting for a given number of
releases.

Signed-off-by: default avatarTorsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
parent dd326670
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment