Skip to content

Commit 7e27eb6

Browse files
pangzhen1xiaomixiaoxiang781216
authored andcommitted
add dependencies for nuttx_post
nuttx_post depends systemmap and usermap(in protected build mode) Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
1 parent 89d6abf commit 7e27eb6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ add_executable(nuttx)
423423
add_custom_target(nuttx_post)
424424
if(CONFIG_BUILD_PROTECTED)
425425
add_executable(nuttx_user)
426+
add_dependencies(nuttx_post nuttx_user)
426427
nuttx_add_library_internal(nuttx_user)
427428
endif()
428429

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

734+
# Generate system map using the compiler toolchain. Conventionally, the tool
735+
# which dump symbols are called nm, though, some compiler toolchain may have a
736+
# different name.
737+
if(NOT WIN32)
738+
add_custom_command(
739+
OUTPUT System.map
740+
COMMAND
741+
${CMAKE_NM} nuttx | grep -v
742+
'\(compiled\)\|\(\${CMAKE_C_OUTPUT_EXTENSION}$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)'
743+
| sort > System.map
744+
DEPENDS nuttx)
745+
add_custom_target(systemmap ALL DEPENDS System.map)
746+
add_dependencies(nuttx_post systemmap)
747+
endif()
748+
733749
# Userspace portion ##########################################################
734750

735751
if(CONFIG_BUILD_PROTECTED)
@@ -798,6 +814,7 @@ if(CONFIG_BUILD_PROTECTED)
798814
COMMAND ${CMAKE_NM} nuttx_user > User.map
799815
DEPENDS nuttx_user)
800816
add_custom_target(usermap ALL DEPENDS User.map)
817+
add_dependencies(nuttx_post usermap)
801818

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

0 commit comments

Comments
 (0)