Skip to content

Commit

Permalink
cmake: extensions: Do not clear variable in zephyr_get MERGE mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nordicjm authored and carlescufi committed May 10, 2023
1 parent ca7a66d commit 87f50bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmake/modules/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 87f50bb

Please sign in to comment.