Skip to content

Commit

Permalink
modules: hal_nordic: cmake: Fix checking if uicr DT node is accessible
Browse files Browse the repository at this point in the history
According to cmake documentation, in the `if(<string>)` expression
the string evaluates to false unless its value is one of the true
constants. Thus, the commands under `if(${uicr_path})` are never
executed. Use `if(DEFINED uicr_path)` instead, since `uicr_path`
is returned by `dt_nodelabel()` and it will be undefined if such
node does not exist.

Signed-off-by: Andrzej Głąbek <[email protected]>
  • Loading branch information
anangl authored and jhedberg committed Oct 13, 2023
1 parent ded2c49 commit 5e38471
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/hal_nordic/nrfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ endif()
# doing the proper configuration sequence during system init

dt_nodelabel(uicr_path NODELABEL "uicr")
if(${uicr_path})
if(DEFINED uicr_path)
dt_prop(nfct_pins_as_gpios PATH ${uicr_path} PROPERTY "nfct-pins-as-gpios")
if(${nfct_pins_as_gpios})
zephyr_library_compile_definitions(CONFIG_NFCT_PINS_AS_GPIOS)
Expand Down

0 comments on commit 5e38471

Please sign in to comment.