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---