Skip to content

Commit

Permalink
drivers/syslog: compile syslog_device.c if console/char/file channel …
Browse files Browse the repository at this point in the history
…enabled

Add conditional compilation to syslog_device.c

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Sep 23, 2024
1 parent 58f25a3 commit 43ebaa9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/syslog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions drivers/syslog/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43ebaa9

Please sign in to comment.