Split the `kernel_service.c` into multiple subcommand files, each file would register with the main `kernel` cmd based on the dependencies in Kconfig/CMakeLists.txt. This greatly reduces the number of precompiler directives. Signed-off-by: Yong Cong Sin <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
22 lines
453 B
CMake
22 lines
453 B
CMake
# Copyright (c) 2024 Meta Platforms
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
zephyr_sources(
|
|
# Main command
|
|
kernel_shell.c
|
|
# Subcommand starts here
|
|
cycles.c
|
|
sleep.c
|
|
uptime.c
|
|
version.c
|
|
)
|
|
|
|
# Conditional subcommands
|
|
zephyr_sources_ifdef(CONFIG_SYS_HEAP_RUNTIME_STATS heap.c)
|
|
|
|
zephyr_sources_ifdef(CONFIG_LOG_RUNTIME_FILTERING log-level.c)
|
|
|
|
zephyr_sources_ifdef(CONFIG_REBOOT reboot.c)
|
|
|
|
add_subdirectory_ifdef(CONFIG_KERNEL_THREAD_SHELL thread)
|