This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new e60305af4 examples/flowc: Add the sources to the CMake build.
e60305af4 is described below
commit e60305af4918790952cc2e484c73d8dd1eb67f70
Author: Max Kriegleder <[email protected]>
AuthorDate: Mon Oct 26 22:38:02 2026 +0100
examples/flowc: Add the sources to the CMake build.
CMakeLists.txt only named the app, with no sources, so a CMake build
with EXAMPLES_FLOWC failed to link: undefined reference to flowc_main.
Build it as the Makefile does: target 1 with the receiver (or the
sender with EXAMPLES_FLOWC_SENDER1), target 2 with the other end when
EXAMPLES_FLOWC_TARGET2, each with its PROGNAME, PRIORITY and STACKSIZE,
and nuttx/config.h reachable as "config.h" (as tcpblaster does). The
host-side tool is still built by the Makefile only.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Max Kriegleder <[email protected]>
---
examples/flowc/CMakeLists.txt | 45 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
diff --git a/examples/flowc/CMakeLists.txt b/examples/flowc/CMakeLists.txt
index fd7d70960..4ae6e0165 100644
--- a/examples/flowc/CMakeLists.txt
+++ b/examples/flowc/CMakeLists.txt
@@ -21,5 +21,48 @@
#
##############################################################################
if(CONFIG_EXAMPLES_FLOWC)
- nuttx_add_application(NAME flowc)
+
+ # Target 1: the receiver, or the sender with EXAMPLES_FLOWC_SENDER1
+
+ if(CONFIG_EXAMPLES_FLOWC_SENDER1)
+ set(SRCS1 flowc_sender.c)
+ set(SRCS2 flowc_receiver.c)
+ else()
+ set(SRCS1 flowc_receiver.c)
+ set(SRCS2 flowc_sender.c)
+ endif()
+
+ nuttx_add_application(
+ NAME
+ ${CONFIG_EXAMPLES_FLOWC_PROGNAME1}
+ PRIORITY
+ ${CONFIG_EXAMPLES_FLOWC_PRIORITY1}
+ STACKSIZE
+ ${CONFIG_EXAMPLES_FLOWC_STACKSIZE1}
+ MODULE
+ ${CONFIG_EXAMPLES_FLOWC}
+ INCLUDE_DIRECTORIES
+ ${NUTTX_BINARY_DIR}/include/nuttx
+ SRCS
+ flowc_target1.c
+ ${SRCS1})
+
+ # Target 2: the other end, when it is a NuttX target and not the host
+
+ if(CONFIG_EXAMPLES_FLOWC_TARGET2)
+ nuttx_add_application(
+ NAME
+ ${CONFIG_EXAMPLES_FLOWC_PROGNAME2}
+ PRIORITY
+ ${CONFIG_EXAMPLES_FLOWC_PRIORITY2}
+ STACKSIZE
+ ${CONFIG_EXAMPLES_FLOWC_STACKSIZE2}
+ MODULE
+ ${CONFIG_EXAMPLES_FLOWC}
+ INCLUDE_DIRECTORIES
+ ${NUTTX_BINARY_DIR}/include/nuttx
+ SRCS
+ flowc_target2.c
+ ${SRCS2})
+ endif()
endif()