From 5e38471e714f41cd7b25b5e22e6b01998329fcda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Fri, 13 Oct 2023 17:03:01 +0200 Subject: [PATCH] modules: hal_nordic: cmake: Fix checking if uicr DT node is accessible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to cmake documentation, in the `if()` 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 --- modules/hal_nordic/nrfx/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 3edab6336c30..4d637ba43f12 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -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)