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 7691b5a6a netutils/dropbear: fix CMake build target names, scp 
includes, and main alias
7691b5a6a is described below

commit 7691b5a6ae40d3e084b542a54ad813cb78155058
Author: Sarthak Pandey <[email protected]>
AuthorDate: Mon Oct 12 22:20:42 2026 +0530

    netutils/dropbear: fix CMake build target names, scp includes, and main 
alias
    
    - Use apps_<name> target names for target_include_directories,
      target_compile_definitions, and target_compile_options.
    - Add missing libtomcrypt and libtommath include directories and
      definitions for apps_scp.
    - Use set_property(... APPEND ...) on dropbear/src/scp.c so the
      main=scp_main alias is preserved.
    - Place dropbear_main.c as the first source in SRCS so nuttx_add_application
      assigns the main alias to it.
    - Remove duplicate target_sources(apps PRIVATE).
    Fixes #3834
    
    Signed-off-by: Sarthak Pandey <[email protected]>
---
 netutils/dropbear/CMakeLists.txt | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/netutils/dropbear/CMakeLists.txt b/netutils/dropbear/CMakeLists.txt
index c429a2a0d..1b5178696 100644
--- a/netutils/dropbear/CMakeLists.txt
+++ b/netutils/dropbear/CMakeLists.txt
@@ -156,8 +156,8 @@ if(CONFIG_NETUTILS_DROPBEAR)
     NAME
     ${PROGNAME}
     SRCS
-    ${DROPBEAR_SRCS}
     dropbear_main.c
+    ${DROPBEAR_SRCS}
     STACKSIZE
     ${CONFIG_NETUTILS_DROPBEAR_STACKSIZE}
     PRIORITY
@@ -180,7 +180,7 @@ if(CONFIG_NETUTILS_DROPBEAR)
   endif()
 
   target_include_directories(
-    ${PROGNAME}
+    apps_${PROGNAME}
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
             ${CMAKE_CURRENT_SOURCE_DIR}/port
             ${CMAKE_CURRENT_SOURCE_DIR}/dropbear
@@ -191,19 +191,23 @@ if(CONFIG_NETUTILS_DROPBEAR)
 
   if(CONFIG_NETUTILS_DROPBEAR_SCP)
     target_include_directories(
-      scp
-      PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/port
+      apps_scp
+      PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+              ${CMAKE_CURRENT_SOURCE_DIR}/port
               ${CMAKE_CURRENT_SOURCE_DIR}/dropbear
-              ${CMAKE_CURRENT_SOURCE_DIR}/dropbear/src)
+              ${CMAKE_CURRENT_SOURCE_DIR}/dropbear/src
+              ${CMAKE_CURRENT_SOURCE_DIR}/dropbear/libtomcrypt/src/headers
+              ${CMAKE_CURRENT_SOURCE_DIR}/dropbear/libtommath)
   endif()
 
   if(CONFIG_NETUTILS_DROPBEAR_COMPRESSION)
     target_include_directories(
-      ${PROGNAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../system/zlib/zlib)
+      apps_${PROGNAME}
+      PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../system/zlib/zlib)
   endif()
 
   target_compile_definitions(
-    ${PROGNAME}
+    apps_${PROGNAME}
     PRIVATE LOCALOPTIONS_H_EXISTS=1
             DROPBEAR_NUTTX=1
             DROPBEAR_NUTTX_PASSWD=1
@@ -213,8 +217,13 @@ if(CONFIG_NETUTILS_DROPBEAR)
 
   if(CONFIG_NETUTILS_DROPBEAR_SCP)
     target_compile_definitions(
-      scp PRIVATE LOCALOPTIONS_H_EXISTS=1 DROPBEAR_NUTTX=1
-                  DROPBEAR_NUTTX_PASSWD=1)
+      apps_scp
+      PRIVATE LOCALOPTIONS_H_EXISTS=1
+              DROPBEAR_NUTTX=1
+              DROPBEAR_NUTTX_PASSWD=1
+              base64_encode=dropbear_ltc_base64_encode
+              base64_decode=dropbear_ltc_base64_decode
+              ecc_make_key=dropbear_ltc_ecc_make_key)
   endif()
 
   set_source_files_properties(
@@ -223,9 +232,10 @@ if(CONFIG_NETUTILS_DROPBEAR)
                "Channel=dropbear_channel;ChanType=dropbear_chantype")
 
   if(CONFIG_NETUTILS_DROPBEAR_SCP)
-    set_source_files_properties(
-      dropbear/src/scp.c
-      PROPERTIES
+    set_property(
+      SOURCE dropbear/src/scp.c
+      APPEND
+      PROPERTY
         COMPILE_DEFINITIONS
         
"xmalloc=dropbear_scp_xmalloc;xrealloc=dropbear_scp_xrealloc;xfree=dropbear_scp_xfree;execvp=dropbear_scp_execvp"
     )
@@ -241,16 +251,14 @@ if(CONFIG_NETUTILS_DROPBEAR)
   set_source_files_properties(${LIBTOMCRYPT_SRCS} PROPERTIES 
COMPILE_DEFINITIONS
                                                              LTC_SOURCE=1)
 
-  target_compile_options(${PROGNAME} PRIVATE -Wno-pointer-sign -Wno-format)
+  target_compile_options(apps_${PROGNAME} PRIVATE -Wno-pointer-sign 
-Wno-format)
 
   if(CONFIG_NETUTILS_DROPBEAR_SCP)
     target_compile_options(
-      scp
+      apps_scp
       PRIVATE -Wno-pointer-sign -Wno-format -include
               ${CMAKE_CURRENT_SOURCE_DIR}/port/nuttx_scp.h
               -Wno-strict-prototypes)
   endif()
 
-  target_sources(apps PRIVATE ${DROPBEAR_SRCS})
-
 endif()

Reply via email to