cmake: extensions: Do not clear variable in zephyr_get MERGE mode

Fixes a regression whereby the variable would be cleared prior to
being used in MERGE mode.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2023-05-05 08:57:57 +01:00 committed by Carles Cufí
commit 87f50bb72b

View file

@ -2508,7 +2508,9 @@ function(zephyr_get variable)
endif()
if(GET_VAR_MERGE)
# Clear variable before appending items in MERGE mode
# Clear variable before appending items in MERGE mode but keep a backup for
# local appending later
set(local_var_backup ${${variable}})
set(${variable})
endif()
@ -2574,6 +2576,7 @@ function(zephyr_get variable)
endif()
if(GET_VAR_MERGE)
list(APPEND ${variable} ${local_var_backup})
list(REMOVE_DUPLICATES ${variable})
set(${variable} ${${variable}} PARENT_SCOPE)
endif()