Skip to content

Commit

Permalink
Support libmctp as a zephyr module
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Burdick <[email protected]>
  • Loading branch information
teburd committed Oct 22, 2024
1 parent b3de343 commit 4bd300d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
23 changes: 23 additions & 0 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2024 Intel Corporation.
#
# SPDX-License-Identifier: BSD-3-Clause

set(MCTP_SRC ${CMAKE_CURRENT_SOURCE_DIR}/..)

zephyr_interface_library_named(mctp)
target_link_libraries(zephyr_interface INTERFACE mctp)
target_include_directories(mctp INTERFACE ${MCTP_SRC})

zephyr_library_named(modules_mctp)
zephyr_library_link_libraries(mctp)

zephyr_library_sources_ifdef(
CONFIG_MCTP
${MCTP_SRC}/alloc.c
${MCTP_SRC}/crc32.c
${MCTP_SRC}/core.c
${MCTP_SRC}/log.c
${MCTP_SRC}/libmctp.h
${MCTP_SRC}/serial.c
${MCTP_SRC}/crc-16-ccitt.c
)
7 changes: 7 additions & 0 deletions zephyr/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

config MCTP
bool "Enable MCTP"
help
Build libmctp module during build process.
4 changes: 4 additions & 0 deletions zephyr/module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: libmctp
build:
cmake: zephyr
kconfig: zephyr/Kconfig

0 comments on commit 4bd300d

Please sign in to comment.