Skip to content

Commit d13a62a

Browse files
build: drop vendored midi2.{h,c} and link midi2_cpp PUBLIC midi2::midi2
This is the final step of the depends=midi2 migration. Every recipe under examples/ has been migrated to pull midi2 externally (Pico SDK + TinyUSB CMake via FetchContent, ESP-IDF via Component Manager, PlatformIO via lib_deps), so the duplicated copy of dist/midi2.{h,c} that lived under src/ no longer has any consumer. Removes: - src/midi2.h - src/midi2.c Updates the root CMakeLists.txt: - find_package + FetchContent now ask for midi2 0.3.3 (matches the ESP-IDF idiom and the Library Manager constraint). - midi2_cpp library target drops src/midi2.c from its source list. - target_link_libraries(midi2_cpp PUBLIC midi2::midi2) exposes the C99 core to downstream link consumers transitively. Bumps the manifest declarations in lockstep: - library.properties: depends=midi2 (>=0.3.3) - library.json: sauloverissimo/midi2: ^0.3.3 Verified locally: cmake configure pulls midi2 v0.3.3 via FetchContent, the host suite (7 executables, including the m2bridge ASan + UBSan smoke) builds and runs clean.
1 parent 05b97dd commit d13a62a

5 files changed

Lines changed: 10 additions & 5155 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,32 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1313
# This is the same pattern the midi2 README documents for downstream
1414
# consumers, applied to midi2_cpp itself.
1515
if(NOT TARGET midi2)
16-
find_package(midi2 0.3.2 QUIET CONFIG)
16+
find_package(midi2 0.3.3 QUIET CONFIG)
1717
if(NOT midi2_FOUND)
1818
include(FetchContent)
1919
FetchContent_Declare(midi2
2020
GIT_REPOSITORY https://github.com/sauloverissimo/midi2.git
21-
GIT_TAG v0.3.2
21+
GIT_TAG v0.3.3
2222
)
2323
FetchContent_MakeAvailable(midi2)
2424
endif()
2525
endif()
2626

2727
# Library target.
2828
#
29-
# src/midi2.c is still compiled here so the host test suite, the
30-
# arduino-cli compile job, and the standalone CMake build all see a
31-
# single coherent translation unit. The recipes under examples/ are
32-
# being migrated to depend on midi2::midi2 directly; once every recipe
33-
# has migrated, src/midi2.{h,c} will be removed and midi2_cpp will
34-
# link against the external midi2 target unconditionally.
29+
# midi2_cpp ships the C++ wrapper sources only; the C99 core lives in
30+
# the external midi2 target this CMakeLists pulls above. Consumers
31+
# linking midi2_cpp transitively see midi2::midi2 because of the
32+
# PUBLIC link below.
3533
add_library(midi2_cpp
36-
src/midi2.c
3734
src/midi2_device.cpp
3835
src/midi2_ci.cpp
3936
src/midi2_host.cpp
4037
src/midi2_bridge.cpp
4138
)
4239

40+
target_link_libraries(midi2_cpp PUBLIC midi2::midi2)
41+
4342
target_include_directories(midi2_cpp
4443
PUBLIC
4544
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"url": "https://github.com/sauloverissimo/midi2_cpp.git"
2020
},
2121
"dependencies": {
22-
"sauloverissimo/midi2": "^0.3.2"
22+
"sauloverissimo/midi2": "^0.3.3"
2323
},
2424
"headers": "midi2_cpp.h",
2525
"export": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ category=Communication
88
url=https://github.com/sauloverissimo/midi2_cpp
99
architectures=*
1010
includes=midi2_cpp.h
11-
depends=midi2 (>=0.3.2)
11+
depends=midi2 (>=0.3.3)

src/midi2.c

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)