This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new a88eb1fc6b2 cmake: enhance the function of cmake nuttx_wildcard_sources
a88eb1fc6b2 is described below

commit a88eb1fc6b257e2fe294c8e110a31dbca4ae3852
Author: Junbo Zheng <zhengjun...@xiaomi.com>
AuthorDate: Mon Jul 14 16:28:17 2025 +0800

    cmake: enhance the function of cmake nuttx_wildcard_sources
    
    align already used cmake ifdef/ifndef nuttx_xxx functions, reference:
    - https://github.com/apache/nuttx/pull/14747
    
    Signed-off-by: Junbo Zheng <zhengjun...@xiaomi.com>
---
 cmake/nuttx_extensions.cmake | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/cmake/nuttx_extensions.cmake b/cmake/nuttx_extensions.cmake
index aa2232e16d4..45852fb8532 100644
--- a/cmake/nuttx_extensions.cmake
+++ b/cmake/nuttx_extensions.cmake
@@ -120,6 +120,31 @@ function(nuttx_wildcard_sources)
   nuttx_sources(${SRCS})
 endfunction()
 
+# Function: nuttx_wildcard_sources_ifdef
+#
+# Conditionally adds source files matching a wildcard pattern to the current
+# library target if the given condition is true.
+#
+# Usage: nuttx_wildcard_sources_ifdef(MY_CONDITION "*.c" EXCLUDE 
"exclude_me.c")
+function(nuttx_wildcard_sources_ifdef cond)
+  if(${cond})
+    nuttx_wildcard_sources(${ARGN})
+  endif()
+endfunction()
+
+# Function: nuttx_wildcard_sources_ifndef
+#
+# Conditionally adds source files matching a wildcard pattern to the current
+# library target if the given condition is false.
+#
+# Usage: nuttx_wildcard_sources_ifndef(MY_CONDITION "*.c" EXCLUDE
+# "exclude_me.c")
+function(nuttx_wildcard_sources_ifndef cond)
+  if(NOT ${cond})
+    nuttx_wildcard_sources(${ARGN})
+  endif()
+endfunction()
+
 # Function: nuttx_include_directories
 #
 # Adds include directories to the current library target.

Reply via email to