Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ project(pylibremidi)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL 1)

set(LIBREMIDI_PYTHON 1)
set(LIBREMIDI_FIND_BOOST 1)
set(LIBREMIDI_HEADER_ONLY 1)
set(LIBREMIDI_NEEDS_READERWRITERQUEUE 1)

add_subdirectory(../.. libremidi-src)

find_package(Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED)
find_package(Python 3.9 COMPONENTS Interpreter Development.Module REQUIRED)

if(NOT readerwriterqueue_FOUND AND NOT TARGET readerwriterqueue)
FetchContent_Declare(
Expand All @@ -30,6 +31,6 @@ FetchContent_Declare(

FetchContent_MakeAvailable(nanobind)
nanobind_add_module(pylibremidi pylibremidi.cpp)
target_link_libraries(pylibremidi PUBLIC libremidi readerwriterqueue Boost::headers)
target_link_libraries(pylibremidi PUBLIC libremidi readerwriterqueue Boost::headers Boost::variant2 Boost::container)

install(TARGETS pylibremidi LIBRARY DESTINATION .)
install(TARGETS pylibremidi LIBRARY DESTINATION .)
18 changes: 12 additions & 6 deletions cmake/libremidi.deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,25 @@ if(LIBREMIDI_NO_BOOST AND LIBREMIDI_FIND_BOOST)
endif()

if(LIBREMIDI_FIND_BOOST)
find_package(Boost OPTIONAL_COMPONENTS cobalt)
set(BOOST_INCLUDE_LIBRARIES headers container)
if(NOT LIBREMIDI_NO_NETWORK)
list(APPEND BOOST_INCLUDE_LIBRARIES asio)
endif()
if(LIBREMIDI_EXAMPLES)
list(APPEND BOOST_INCLUDE_LIBRARIES cobalt)
endif()
if(LIBREMIDI_PYTHON)
list(APPEND BOOST_INCLUDE_LIBRARIES variant2)
endif()
find_package(Boost 1.90 OPTIONAL_COMPONENTS ${BOOST_INCLUDE_LIBRARIES})

if(NOT Boost_FOUND)
set(BOOST_ENABLE_CMAKE ON)
set(BOOST_INCLUDE_LIBRARIES container asio variant2 cobalt)

FetchContent_Declare(
Boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-1.89.0
GIT_PROGRESS ON
GIT_SHALLOW TRUE
OVERRIDE_FIND_PACKAGE TRUE
URL "https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0-cmake.tar.xz"
)

FetchContent_MakeAvailable(Boost)
Expand Down
3 changes: 3 additions & 0 deletions include/libremidi/backends/net/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
#include <libremidi/config.hpp>

#include <string>

#if !defined(BOOST_ASIO_IO_CONTEXT_HPP)
namespace boost::asio
{
struct io_context;
}
#endif

NAMESPACE_LIBREMIDI::net
{
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,3 @@ build-dir = "build/{wheel_tag}"

# Build stable ABI wheels for CPython 3.10+
wheel.py-api = "cp310"

[tool.cibuildwheel]
before-all = "yum install -y boost-devel || apt-get update && apt-get install -y libboost-all-dev || apk add boost-dev"
Loading