Skip to content

Commit

Permalink
cmake: fix variable de-referencing in zephyr_check_compiler_x functions
Browse files Browse the repository at this point in the history
Fixes: #53124

Fix de-referencing of check and exists function arguments by correctly
de-referencing the argument references using `${<var>}`.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 04a2765)
  • Loading branch information
tejlmand authored and fabiobaltieri committed Mar 3, 2023
1 parent b3ab666 commit 2b6e40e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 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 Expand Up @@ -1121,11 +1121,11 @@ function(zephyr_check_compiler_flag_hardcoded lang option check exists)
# because they would produce a warning instead of an error during
# the test. Exclude them by toolchain-specific blocklist.
if((${lang} STREQUAL CXX) AND ("${option}" IN_LIST CXX_EXCLUDED_OPTIONS))
set(check 0 PARENT_SCOPE)
set(exists 1 PARENT_SCOPE)
set(${check} 0 PARENT_SCOPE)
set(${exists} 1 PARENT_SCOPE)
else()
# There does not exist a hardcoded check for this option.
set(exists 0 PARENT_SCOPE)
set(${exists} 0 PARENT_SCOPE)
endif()
endfunction(zephyr_check_compiler_flag_hardcoded)

Expand Down

0 comments on commit 2b6e40e

Please sign in to comment.