mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
cmake(bugfix):use apps_post to identify the stage of app completion
nuttx_post for all target done apps_post for all apps lib done Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
@@ -117,7 +117,7 @@ function(nuttx_add_application)
|
|||||||
# non-elf output
|
# non-elf output
|
||||||
if(NOT CMAKE_C_ELF_COMPILER)
|
if(NOT CMAKE_C_ELF_COMPILER)
|
||||||
add_library(${TARGET} ${SRCS})
|
add_library(${TARGET} ${SRCS})
|
||||||
add_dependencies(${TARGET} nuttx_post)
|
add_dependencies(${TARGET} apps_post)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${TARGET}
|
TARGET ${TARGET}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ endfunction()
|
|||||||
function(nuttx_add_aux_library target)
|
function(nuttx_add_aux_library target)
|
||||||
# declare target
|
# declare target
|
||||||
add_library(${target} OBJECT ${ARGN})
|
add_library(${target} OBJECT ${ARGN})
|
||||||
|
# make sure context and post time ordering
|
||||||
|
add_dependencies(${target} apps_context)
|
||||||
|
add_dependencies(apps_post ${target})
|
||||||
nuttx_add_library_internal(${target} ${ARGN})
|
nuttx_add_library_internal(${target} ${ARGN})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
@@ -93,7 +95,10 @@ endfunction()
|
|||||||
function(nuttx_add_user_library target)
|
function(nuttx_add_user_library target)
|
||||||
# declare target
|
# declare target
|
||||||
add_library(${target} OBJECT ${ARGN})
|
add_library(${target} OBJECT ${ARGN})
|
||||||
|
# make sure context and post time ordering
|
||||||
add_dependencies(${target} apps_context)
|
add_dependencies(${target} apps_context)
|
||||||
|
add_dependencies(apps_post ${target})
|
||||||
|
|
||||||
nuttx_add_library_internal(${target} ${ARGN})
|
nuttx_add_library_internal(${target} ${ARGN})
|
||||||
|
|
||||||
# link to final libapps
|
# link to final libapps
|
||||||
@@ -112,6 +117,9 @@ endfunction()
|
|||||||
function(nuttx_add_system_library target)
|
function(nuttx_add_system_library target)
|
||||||
# declare target
|
# declare target
|
||||||
add_library(${target} ${ARGN})
|
add_library(${target} ${ARGN})
|
||||||
|
# make sure context and post time ordering
|
||||||
|
add_dependencies(${target} apps_context)
|
||||||
|
add_dependencies(apps_post ${target})
|
||||||
|
|
||||||
# add library to build
|
# add library to build
|
||||||
nuttx_add_library_internal(${target} ${ARGN})
|
nuttx_add_library_internal(${target} ${ARGN})
|
||||||
@@ -124,7 +132,6 @@ function(nuttx_add_system_library target)
|
|||||||
APPEND
|
APPEND
|
||||||
PROPERTY NUTTX_ELF_LINK_LIBRARIES $<TARGET_FILE:${target}>)
|
PROPERTY NUTTX_ELF_LINK_LIBRARIES $<TARGET_FILE:${target}>)
|
||||||
|
|
||||||
add_dependencies(nuttx_post ${target})
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Kernel Libraries
|
# Kernel Libraries
|
||||||
@@ -201,7 +208,9 @@ define_property(
|
|||||||
#
|
#
|
||||||
function(nuttx_add_library target)
|
function(nuttx_add_library target)
|
||||||
add_library(${target} ${ARGN})
|
add_library(${target} ${ARGN})
|
||||||
|
# make sure context and post time ordering
|
||||||
add_dependencies(${target} apps_context)
|
add_dependencies(${target} apps_context)
|
||||||
|
add_dependencies(apps_post ${target})
|
||||||
set_property(GLOBAL APPEND PROPERTY NUTTX_SYSTEM_LIBRARIES ${target})
|
set_property(GLOBAL APPEND PROPERTY NUTTX_SYSTEM_LIBRARIES ${target})
|
||||||
|
|
||||||
set_property(
|
set_property(
|
||||||
@@ -209,8 +218,6 @@ function(nuttx_add_library target)
|
|||||||
APPEND
|
APPEND
|
||||||
PROPERTY NUTTX_ELF_LINK_LIBRARIES $<TARGET_FILE:${target}>)
|
PROPERTY NUTTX_ELF_LINK_LIBRARIES $<TARGET_FILE:${target}>)
|
||||||
|
|
||||||
add_dependencies(nuttx_post ${target})
|
|
||||||
|
|
||||||
# Set apps global compile options & definitions hold by nuttx_apps_interface
|
# Set apps global compile options & definitions hold by nuttx_apps_interface
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
${target}
|
${target}
|
||||||
@@ -279,12 +286,15 @@ endfunction()
|
|||||||
function(nuttx_add_external_library target)
|
function(nuttx_add_external_library target)
|
||||||
cmake_parse_arguments(ARGS "" MODE "" ${ARGN})
|
cmake_parse_arguments(ARGS "" MODE "" ${ARGN})
|
||||||
if(NOT ARGS_MODE)
|
if(NOT ARGS_MODE)
|
||||||
|
# if we add external library as system lib, make sure context and post time
|
||||||
|
# ordering
|
||||||
|
add_dependencies(${target} apps_context)
|
||||||
|
add_dependencies(apps_post ${target})
|
||||||
set_property(GLOBAL APPEND PROPERTY NUTTX_SYSTEM_LIBRARIES ${target})
|
set_property(GLOBAL APPEND PROPERTY NUTTX_SYSTEM_LIBRARIES ${target})
|
||||||
set_property(
|
set_property(
|
||||||
TARGET nuttx_global
|
TARGET nuttx_global
|
||||||
APPEND
|
APPEND
|
||||||
PROPERTY NUTTX_ELF_LINK_LIBRARIES $<TARGET_FILE:${target}>)
|
PROPERTY NUTTX_ELF_LINK_LIBRARIES $<TARGET_FILE:${target}>)
|
||||||
add_dependencies(nuttx_post ${target})
|
|
||||||
elseif("${ARGS_MODE}" STREQUAL "APPS")
|
elseif("${ARGS_MODE}" STREQUAL "APPS")
|
||||||
set_property(GLOBAL APPEND PROPERTY NUTTX_APPS_LIBRARIES ${target})
|
set_property(GLOBAL APPEND PROPERTY NUTTX_APPS_LIBRARIES ${target})
|
||||||
elseif("${ARGS_MODE}" STREQUAL "KERNEL")
|
elseif("${ARGS_MODE}" STREQUAL "KERNEL")
|
||||||
|
|||||||
@@ -156,3 +156,7 @@ add_custom_target(
|
|||||||
# apps_context is a PHONY target used as an intermediate process to control the
|
# apps_context is a PHONY target used as an intermediate process to control the
|
||||||
# time order of context preparation actions of app building
|
# time order of context preparation actions of app building
|
||||||
add_custom_target(apps_context ALL DEPENDS nuttx_context)
|
add_custom_target(apps_context ALL DEPENDS nuttx_context)
|
||||||
|
|
||||||
|
# apps_post is a PHONY target used as an intermediate process to control the
|
||||||
|
# time order of all apps library has been built
|
||||||
|
add_custom_target(apps_post)
|
||||||
|
|||||||
Reference in New Issue
Block a user