From 9bcfd1a7f7535cf99b9681521eda94a30652bd00 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Fri, 8 Sep 2023 18:37:31 +0300 Subject: [PATCH] cmake/kconfig.cmake: Don't populate config_kernel_list in nuttx flat builds This passes __KERNEL__ compilation flag to all modules, which may break some NuttX headers Signed-off-by: Jukka Laitinen --- cmake/kconfig.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/kconfig.cmake b/cmake/kconfig.cmake index ea5e48800e..f96a62b67b 100644 --- a/cmake/kconfig.cmake +++ b/cmake/kconfig.cmake @@ -216,15 +216,17 @@ if(EXISTS ${BOARD_DEFCONFIG}) endforeach() - # Put every module not in userspace also to kernel list - foreach(modpath ${config_module_list}) + if (CONFIG_BOARD_PROTECTED) + # Put every module not in userspace also to kernel list + foreach(modpath ${config_module_list}) get_filename_component(module ${modpath} NAME) list(FIND config_user_list ${module} _index) if (${_index} EQUAL -1) list(APPEND config_kernel_list ${modpath}) endif() - endforeach() + endforeach() + endif() if(PLATFORM) # set OS, and append specific platform module path