Skip to content

Commit 4bd300d

Browse files
committed
Support libmctp as a zephyr module
Signed-off-by: Tom Burdick <[email protected]>
1 parent b3de343 commit 4bd300d

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

zephyr/CMakeLists.txt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2024 Intel Corporation.
2+
#
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
5+
set(MCTP_SRC ${CMAKE_CURRENT_SOURCE_DIR}/..)
6+
7+
zephyr_interface_library_named(mctp)
8+
target_link_libraries(zephyr_interface INTERFACE mctp)
9+
target_include_directories(mctp INTERFACE ${MCTP_SRC})
10+
11+
zephyr_library_named(modules_mctp)
12+
zephyr_library_link_libraries(mctp)
13+
14+
zephyr_library_sources_ifdef(
15+
CONFIG_MCTP
16+
${MCTP_SRC}/alloc.c
17+
${MCTP_SRC}/crc32.c
18+
${MCTP_SRC}/core.c
19+
${MCTP_SRC}/log.c
20+
${MCTP_SRC}/libmctp.h
21+
${MCTP_SRC}/serial.c
22+
${MCTP_SRC}/crc-16-ccitt.c
23+
)

zephyr/Kconfig

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config MCTP
5+
bool "Enable MCTP"
6+
help
7+
Build libmctp module during build process.

zephyr/module.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: libmctp
2+
build:
3+
cmake: zephyr
4+
kconfig: zephyr/Kconfig

0 commit comments

Comments
 (0)