drivers/syslog: compile syslog_device.c if console/char/file channel enabled

Add conditional compilation to syslog_device.c

Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
chao an 2024-09-23 10:30:22 +08:00 committed by Xiang Xiao
parent ab4d72756e
commit db5320fd9f
2 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -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