Skip to content

Commit

Permalink
cmake: prefix local version of return variable
Browse files Browse the repository at this point in the history
Fixes: #55490
Follow-up: #53124

Prefix local version of the return variable before calling
`zephyr_check_compiler_flag_hardcoded()`.

This ensures that there will never be any naming collision between named
return argument and the variable name used in later functions when
PARENT_SCOPE is used.

The issue #55490 provided description of situation where the double
de-referencing was not working correctly.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 599886a)
  • Loading branch information
tejlmand authored and github-actions[bot] committed Mar 7, 2023
1 parent 2b6e40e commit 2b5d5be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/modules/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1014,9 +1014,9 @@ endfunction()
function(zephyr_check_compiler_flag lang option check)
# Check if the option is covered by any hardcoded check before doing
# an automated test.
zephyr_check_compiler_flag_hardcoded(${lang} "${option}" ${check} exists)
zephyr_check_compiler_flag_hardcoded(${lang} "${option}" _${check} exists)
if(exists)
set(${check} ${${check}} PARENT_SCOPE)
set(${check} ${_${check}} PARENT_SCOPE)
return()
endif()

Expand Down

0 comments on commit 2b5d5be

Please sign in to comment.