From e9e01506d31f5fb26a4199ad3eb8e179508d84a2 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Sun, 6 Oct 2024 23:10:59 +0800 Subject: [PATCH] dlcn:need select MODULES when compile Signed-off-by: anjiahao --- cmake/nuttx_add_application.cmake | 18 ++++++++++-------- libs/libc/dlfcn/Kconfig | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cmake/nuttx_add_application.cmake b/cmake/nuttx_add_application.cmake index f9efc03bed2da..d6f3ad592a269 100644 --- a/cmake/nuttx_add_application.cmake +++ b/cmake/nuttx_add_application.cmake @@ -130,6 +130,16 @@ function(nuttx_add_application) nuttx_add_library_internal(${TARGET}) + # loadable build requires applying ELF flags to all applications + + if(CONFIG_MODULES) + target_compile_options( + ${TARGET} + PRIVATE + $> + ) + endif() + install(TARGETS ${TARGET}) set_property( TARGET nuttx @@ -155,14 +165,6 @@ function(nuttx_add_application) endif() endif() - # loadable build requires applying ELF flags to all applications - - if(CONFIG_MODULES) - target_compile_options( - ${TARGET} - PRIVATE - $>) - endif() else() set(TARGET "apps_${NAME}") add_custom_target(${TARGET}) diff --git a/libs/libc/dlfcn/Kconfig b/libs/libc/dlfcn/Kconfig index 7ee9cce378695..d5b4c63de6eb5 100644 --- a/libs/libc/dlfcn/Kconfig +++ b/libs/libc/dlfcn/Kconfig @@ -8,6 +8,7 @@ config LIBC_DLFCN bool "Shared library support" default n + select MODULES select LIBC_MODLIB if !BUILD_FLAT select MODULE if BUILD_FLAT ---help---