Skip to content

Commit 29c796e

Browse files
committed
CMakeLists.txt: Build the ArduinoCore-API implementations
With the introduction of `west blobs`, the licensing situation is now clear, so we can include the ArduinoCore-API implementations in the build. Exclude `zephyrPrint.cpp` as it conflicts with the API implementations. Also exclude `apiCommon.cpp`, which is only used by the Rust build. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
1 parent 396da38 commit 29c796e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ if (CONFIG_ARDUINO_API)
8686
zephyr_link_libraries(arduinocore_api_rust)
8787
else()
8888
zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/zephyr/blobs/ArduinoCore-API/)
89+
zephyr_sources(${CMAKE_CURRENT_SOURCE_DIR}/zephyr/blobs/ArduinoCore-API/api/CanMsg.cpp)
90+
zephyr_sources(${CMAKE_CURRENT_SOURCE_DIR}/zephyr/blobs/ArduinoCore-API/api/CanMsgRingbuffer.cpp)
91+
zephyr_sources(${CMAKE_CURRENT_SOURCE_DIR}/zephyr/blobs/ArduinoCore-API/api/Common.cpp)
92+
zephyr_sources(${CMAKE_CURRENT_SOURCE_DIR}/zephyr/blobs/ArduinoCore-API/api/IPAddress.cpp)
93+
zephyr_sources(${CMAKE_CURRENT_SOURCE_DIR}/zephyr/blobs/ArduinoCore-API/api/Print.cpp)
94+
zephyr_sources(${CMAKE_CURRENT_SOURCE_DIR}/zephyr/blobs/ArduinoCore-API/api/Stream.cpp)
95+
zephyr_sources(${CMAKE_CURRENT_SOURCE_DIR}/zephyr/blobs/ArduinoCore-API/api/String.cpp)
8996
endif()
9097

9198
endif()

cores/arduino/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ zephyr_include_directories(../../variants)
1111

1212
if(NOT DEFINED ARDUINO_BUILD_PATH)
1313

14-
zephyr_sources(zephyrPrint.cpp)
1514
zephyr_sources(zephyrSerial.cpp)
1615
zephyr_sources(zephyrCommon.cpp)
17-
zephyr_sources(apiCommon.cpp)
16+
17+
if(CONFIG_USE_ARDUINO_API_RUST_IMPLEMENTATION)
18+
zephyr_sources(zephyrPrint.cpp)
19+
zephyr_sources(apiCommon.cpp)
20+
endif()
1821

1922
if(DEFINED CONFIG_ARDUINO_ENTRY)
2023
zephyr_sources(main.cpp)

0 commit comments

Comments
 (0)