summaryrefslogtreecommitdiff
path: root/cmd/srv9p/CMakeLists.txt
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-10 00:41:14 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-10 01:46:28 -0700
commit7bc1e8049dbbf572a773d01547eb9b587b112061 (patch)
tree0fae40ea47ef4d8f56fea794deb37a96ac119feb /cmd/srv9p/CMakeLists.txt
parent6a719c63ecb83a850c317ea94b8932aa0c857770 (diff)
Analyze host stacks too
Diffstat (limited to 'cmd/srv9p/CMakeLists.txt')
-rw-r--r--cmd/srv9p/CMakeLists.txt33
1 files changed, 25 insertions, 8 deletions
diff --git a/cmd/srv9p/CMakeLists.txt b/cmd/srv9p/CMakeLists.txt
index b747882..4b6ec32 100644
--- a/cmd/srv9p/CMakeLists.txt
+++ b/cmd/srv9p/CMakeLists.txt
@@ -5,21 +5,38 @@
if (PICO_PLATFORM STREQUAL "host")
-add_executable(srv9p
+# Compile ######################################################################
+
+add_library(srv9p_objs OBJECT
main.c
static9p.c
)
-target_embed_sources(srv9p static.h
- static/README.md
- static/Documentation/x
-)
-target_include_directories(srv9p PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
-target_include_directories(srv9p PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
-target_link_libraries(srv9p
+target_include_directories(srv9p_objs PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
+target_include_directories(srv9p_objs PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+target_link_libraries(srv9p_objs
libcr
libcr_ipc
libmisc
lib9p
)
+# Analyze the stack ############################################################
+
+add_stack_analysis(srv9p_stack.c srv9p_objs)
+
+# Link #########################################################################
+
+add_executable(srv9p)
+target_sources(srv9p PRIVATE
+ srv9p_stack.c
+ "$<TARGET_OBJECTS:srv9p_objs>"
+)
+
+# Embed ########################################################################
+
+target_embed_sources(srv9p_objs srv9p static.h
+ static/README.md
+ static/Documentation/x
+)
+
endif()