diff --git a/cmake/nuttx_add_application.cmake b/cmake/nuttx_add_application.cmake index 4701987c6b4..a65b3961646 100644 --- a/cmake/nuttx_add_application.cmake +++ b/cmake/nuttx_add_application.cmake @@ -167,6 +167,10 @@ function(nuttx_add_application) set_property(GLOBAL APPEND PROPERTY NUTTX_APPS_ONLY_REGISTER ${TARGET}) endif() + # apps applications need to depends on apps_context by default + + add_dependencies(${TARGET} apps_context) + # store parameters into properties (used during builtin list generation) set_target_properties(${TARGET} PROPERTIES APP_MAIN ${NAME}_main) diff --git a/cmake/nuttx_add_library.cmake b/cmake/nuttx_add_library.cmake index ac371790671..be15857d10c 100644 --- a/cmake/nuttx_add_library.cmake +++ b/cmake/nuttx_add_library.cmake @@ -79,7 +79,7 @@ endfunction() function(nuttx_add_user_library target) # declare target add_library(${target} OBJECT ${ARGN}) - + add_dependencies(${target} apps_context) nuttx_add_library_internal(${target} ${ARGN}) # link to final libapps @@ -180,7 +180,7 @@ define_property( # function(nuttx_add_library target) add_library(${target} ${ARGN}) - + add_dependencies(${target} apps_context) set_property(GLOBAL APPEND PROPERTY NUTTX_SYSTEM_LIBRARIES ${target}) nuttx_add_library_internal(${target}) diff --git a/cmake/nuttx_generate_headers.cmake b/cmake/nuttx_generate_headers.cmake index af12b4352ad..f6803e9e68e 100644 --- a/cmake/nuttx_generate_headers.cmake +++ b/cmake/nuttx_generate_headers.cmake @@ -152,3 +152,7 @@ add_custom_target( $<$:${CMAKE_BINARY_DIR}/include/math.h> $<$:${CMAKE_BINARY_DIR}/include/float.h> $<$:${CMAKE_BINARY_DIR}/include/setjmp.h>) + +# apps_context is a PHONY target used as an intermediate process to control the +# time order of context preparation actions of app building +add_custom_target(apps_context ALL DEPENDS nuttx_context)