Skip to content

Commit f400a09

Browse files
committed
feat(I3C): Add I3C CMake Support
Signed-off-by: Aymane Bahssain <aymane.bahssain@st.com>
1 parent 916bc49 commit f400a09

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

cmake/templates/easy_cmake.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ build_sketch(TARGET "{{tgtname or "@binary_name_here@"}}"
9090
# DEPENDS
9191
# SD
9292
# Wire
93+
# I3C
9394
# SPI
9495
# USBDevice
9596
# VirtIO

libraries/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ add_subdirectory(SrcWrapper)
1313
add_subdirectory(USBDevice)
1414
add_subdirectory(VirtIO)
1515
add_subdirectory(Wire)
16+
add_subdirectory(I3C)

libraries/I3C/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
5+
add_library(I3C INTERFACE)
6+
add_library(I3C_usage INTERFACE)
7+
8+
target_include_directories(I3C_usage INTERFACE
9+
src
10+
)
11+
12+
13+
target_link_libraries(I3C_usage INTERFACE
14+
base_config
15+
)
16+
17+
target_link_libraries(I3C INTERFACE I3C_usage)
18+
19+
20+
21+
add_library(I3C_bin OBJECT EXCLUDE_FROM_ALL
22+
src/I3C.cpp
23+
src/I3C_I2C.cpp
24+
)
25+
target_link_libraries(I3C_bin PUBLIC I3C_usage)
26+
27+
target_link_libraries(I3C INTERFACE
28+
I3C_bin
29+
$<TARGET_OBJECTS:I3C_bin>
30+
)

0 commit comments

Comments
 (0)