From 4a01446a7208130bbce12d853b4ddd9cd6c7fae9 Mon Sep 17 00:00:00 2001 From: Wolfgang Puffitsch Date: Fri, 19 Feb 2021 13:03:35 +0100 Subject: [PATCH] cmake: modules: Remove duplicates only from existing ZEPHYR_MODULE_NAMES Remove duplicates from ZEPHYR_MODULE_NAMES only if that list exists. That avoids cmake error "list sub-command REMOVE_DUPLICATES requires list to be present" if ZEPHYR_MODULE_NAMES is empty. Signed-off-by: Wolfgang Puffitsch --- cmake/zephyr_module.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/zephyr_module.cmake b/cmake/zephyr_module.cmake index 6e3d60e05f1..c5fbc06ac88 100644 --- a/cmake/zephyr_module.cmake +++ b/cmake/zephyr_module.cmake @@ -123,4 +123,6 @@ else() endif() -list(REMOVE_DUPLICATES ZEPHYR_MODULE_NAMES) +if(DEFINED ZEPHYR_MODULE_NAMES) + list(REMOVE_DUPLICATES ZEPHYR_MODULE_NAMES) +endif()