Skip to content

Commit

Permalink
add dependencies for nuttx_post
Browse files Browse the repository at this point in the history
nuttx_post depends systemmap and usermap(in protected build mode)

Signed-off-by: xuxin19 <[email protected]>
  • Loading branch information
pangzhen1xiaomi authored and xuxin930 committed Oct 14, 2024
1 parent b964eee commit 98a2787
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ add_executable(nuttx)
add_custom_target(nuttx_post)
if(CONFIG_BUILD_PROTECTED)
add_executable(nuttx_user)
add_dependencies(nuttx_post nuttx_user)
nuttx_add_library_internal(nuttx_user)
endif()

Expand Down Expand Up @@ -730,6 +731,21 @@ if(CONFIG_ARCH_SIM)
file(APPEND ${CMAKE_BINARY_DIR}/nuttx.manifest "nuttx\n")
endif()

# Generate system map using the compiler toolchain. Conventionally, the tool
# which dump symbols are called nm, though, some compiler toolchain may have a
# different name.
if(NOT WIN32)
add_custom_command(
OUTPUT System.map
COMMAND
${CMAKE_NM} nuttx | grep -v
'\(compiled\)\|\(\${CMAKE_C_OUTPUT_EXTENSION}$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)'
| sort > System.map
DEPENDS nuttx)
add_custom_target(systemmap ALL DEPENDS System.map)
add_dependencies(nuttx_post systemmap)
endif()

# Userspace portion ##########################################################

if(CONFIG_BUILD_PROTECTED)
Expand Down Expand Up @@ -798,6 +814,7 @@ if(CONFIG_BUILD_PROTECTED)
COMMAND ${CMAKE_NM} nuttx_user > User.map
DEPENDS nuttx_user)
add_custom_target(usermap ALL DEPENDS User.map)
add_dependencies(nuttx_post usermap)

# generate binary outputs in different formats (.bin, .hex, etc)
nuttx_generate_outputs(nuttx_user)
Expand Down

0 comments on commit 98a2787

Please sign in to comment.