cmake: extensions: Robustify dt_node_has_status
Calling this function with an output variable named `var` or `okay` could produce an incorrect result, due to the variable being mishandled. Add simple changes to avoid this. Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
This commit is contained in:
parent
28eb47922e
commit
de85a208a0
@ -3267,13 +3267,13 @@ function(dt_node_has_status var)
|
||||
return()
|
||||
endif()
|
||||
|
||||
dt_prop(${var} PATH ${canonical} PROPERTY status)
|
||||
dt_prop(status PATH ${canonical} PROPERTY status)
|
||||
|
||||
if(NOT DEFINED ${var} OR "${${var}}" STREQUAL ok)
|
||||
set(${var} okay)
|
||||
if(NOT DEFINED status OR status STREQUAL "ok")
|
||||
set(status "okay")
|
||||
endif()
|
||||
|
||||
if(${var} STREQUAL ${DT_NODE_STATUS})
|
||||
if(status STREQUAL "${DT_NODE_STATUS}")
|
||||
set(${var} TRUE PARENT_SCOPE)
|
||||
else()
|
||||
set(${var} FALSE PARENT_SCOPE)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user