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 db5320fd9f drivers/syslog: compile syslog_device.c if
console/char/file channel enabled
db5320fd9f is described below
commit db5320fd9f0909e3c9b4efe23e87c47b23b5ea34
Author: chao an <[email protected]>
AuthorDate: Mon Sep 23 10:30:22 2024 +0800
drivers/syslog: compile syslog_device.c if console/char/file channel enabled
Add conditional compilation to syslog_device.c
Signed-off-by: chao an <[email protected]>
---
drivers/syslog/CMakeLists.txt | 6 +++++-
drivers/syslog/Make.defs | 2 ++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/syslog/CMakeLists.txt b/drivers/syslog/CMakeLists.txt
index 2378b96624..27192ca4f5 100644
--- a/drivers/syslog/CMakeLists.txt
+++ b/drivers/syslog/CMakeLists.txt
@@ -41,7 +41,11 @@ endif()
# System logging to a character device (or file)
-list(APPEND SRCS syslog_device.c)
+if(CONFIG_SYSLOG_CONSOLE
+ OR CONFIG_SYSLOG_CHAR
+ OR CONFIG_SYSLOG_FILE)
+ list(APPEND SRCS syslog_device.c)
+endif()
if(CONFIG_SYSLOG_CHAR)
list(APPEND SRCS syslog_devchannel.c)
diff --git a/drivers/syslog/Make.defs b/drivers/syslog/Make.defs
index 607f1c373e..3c728d4a3a 100644
--- a/drivers/syslog/Make.defs
+++ b/drivers/syslog/Make.defs
@@ -47,7 +47,9 @@ endif
# System logging to a character device (or file)
+ifneq ($(CONFIG_SYSLOG_CONSOLE)$(CONFIG_SYSLOG_CHAR)$(CONFIG_SYSLOG_FILE),)
CSRCS += syslog_device.c
+endif
ifeq ($(CONFIG_SYSLOG_CHAR),y)
CSRCS += syslog_devchannel.c