File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,12 +73,30 @@ family_initialize_project(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR})
7373# midi2_cpp parent library (consumed via ../../src, not vendored)
7474# ----------------------------------------------------------------------
7575set (MIDI2_CPP_ROOT "${CMAKE_CURRENT_SOURCE_DIR } /../.." )
76+
77+ # midi2 C99 core, pulled externally so the recipe shares one source
78+ # of truth with the rest of the ecosystem. Override with
79+ # -DMIDI2_LOCAL_PATH=/path/to/midi2 for offline builds.
80+ include (FetchContent )
81+ if (NOT TARGET midi2)
82+ if (DEFINED MIDI2_LOCAL_PATH)
83+ FetchContent_Declare (midi2 SOURCE_DIR ${MIDI2_LOCAL_PATH} )
84+ else ()
85+ FetchContent_Declare (midi2
86+ GIT_REPOSITORY https://github.com/sauloverissimo/midi2.git
87+ GIT_TAG v0.3.2
88+ GIT_SHALLOW TRUE
89+ )
90+ endif ()
91+ FetchContent_MakeAvailable (midi2)
92+ endif ()
93+
7694add_library (midi2_cpp STATIC
77- ${MIDI2_CPP_ROOT} /src/midi2.c
7895 ${MIDI2_CPP_ROOT} /src/midi2_device.cpp
7996 ${MIDI2_CPP_ROOT} /src/midi2_ci.cpp
8097)
8198target_include_directories (midi2_cpp PUBLIC ${MIDI2_CPP_ROOT} /src )
99+ target_link_libraries (midi2_cpp PUBLIC midi2::midi2 )
82100target_compile_features (midi2_cpp PUBLIC cxx_std_17 )
83101target_compile_options (midi2_cpp PRIVATE -fno-rtti -fno-exceptions -fno-use-cxa-atexit )
84102
Original file line number Diff line number Diff line change @@ -63,12 +63,30 @@ family_initialize_project(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR})
6363# midi2_cpp parent library (consumed via ../../src, not vendored)
6464# ----------------------------------------------------------------------
6565set (MIDI2_CPP_ROOT "${CMAKE_CURRENT_SOURCE_DIR } /../.." )
66+
67+ # midi2 C99 core, pulled externally so the recipe shares one source
68+ # of truth with the rest of the ecosystem. Override with
69+ # -DMIDI2_LOCAL_PATH=/path/to/midi2 for offline builds.
70+ include (FetchContent )
71+ if (NOT TARGET midi2)
72+ if (DEFINED MIDI2_LOCAL_PATH)
73+ FetchContent_Declare (midi2 SOURCE_DIR ${MIDI2_LOCAL_PATH} )
74+ else ()
75+ FetchContent_Declare (midi2
76+ GIT_REPOSITORY https://github.com/sauloverissimo/midi2.git
77+ GIT_TAG v0.3.2
78+ GIT_SHALLOW TRUE
79+ )
80+ endif ()
81+ FetchContent_MakeAvailable (midi2)
82+ endif ()
83+
6684add_library (midi2_cpp STATIC
67- ${MIDI2_CPP_ROOT} /src/midi2.c
6885 ${MIDI2_CPP_ROOT} /src/midi2_device.cpp
6986 ${MIDI2_CPP_ROOT} /src/midi2_ci.cpp
7087)
7188target_include_directories (midi2_cpp PUBLIC ${MIDI2_CPP_ROOT} /src )
89+ target_link_libraries (midi2_cpp PUBLIC midi2::midi2 )
7290target_compile_features (midi2_cpp PUBLIC cxx_std_17 )
7391# midi2_cpp uses std::function / std::array; exceptions stay off (default
7492# in arm-none-eabi-gcc with -fno-exceptions which TinyUSB build sets).
You can’t perform that action at this time.
0 commit comments