c3368d0a91
- native_bridge/: InstrumentEngineManager multi-channel, sample-accurate, CC/program/pitchbend, transport, Vst3Instrument stub (HAVE_VST3SDK) - src-tauri: shm.rs, bridge spawn + audio pump + health monitor, open_vst_gui, externalBin, commands - app: UnifiedMidiRouter, NativeBridgeService, bridgeAudioNode, audioRoutingEngine, Plugin Manager UI, Bridge/WASM indicator, set_position sync - build: 3 ps1 (force-added, build/ ignored), verify_bundle --check-bridge, CI workflow - docs: TASKS.md, TEST_NOTES.md (Windows verify checklist), install/report updates
60 lines
2.0 KiB
CMake
60 lines
2.0 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(daw_vst_bridge LANGUAGES C CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# ── 1. VST3 SDK (Steinberg, vendored as git submodule — NOT in vcpkg) ──
|
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/vst3sdk/CMakeLists.txt")
|
|
add_subdirectory(vst3sdk EXCLUDE_FROM_ALL)
|
|
set(VST3_SDK_TARGET sdk)
|
|
else()
|
|
message(WARNING "vst3sdk submodule missing — VST3 host disabled; SF2/SF3/SFZ still build")
|
|
set(VST3_SDK_TARGET "")
|
|
endif()
|
|
|
|
# ── 2. FluidSynth + sfizz ──
|
|
# Windows: vcpkg toolchain (-DCMAKE_TOOLCHAIN_FILE=.../vcpkg.cmake) cung cap
|
|
# headers/libs; pkg_check_modules khong co san tren MSVC.
|
|
# Linux/macOS: pkg-config duoc dung (spec goc).
|
|
if(WIN32)
|
|
find_path(FLUIDSYNTH_INCLUDE_DIR fluidsynth.h)
|
|
find_library(FLUIDSYNTH_LIBRARY NAMES fluidsynth libfluidsynth)
|
|
if(NOT FLUIDSYNTH_INCLUDE_DIR OR NOT FLUIDSYNTH_LIBRARY)
|
|
message(FATAL_ERROR "fluidsynth not found — cai qua vcpkg: vcpkg install fluidsynth")
|
|
endif()
|
|
# sfizz: header sfizz.hpp + lib sfizz (vcpkg export target sfizz::sfizz neu co)
|
|
find_path(SFIZZ_INCLUDE_DIR sfizz.hpp)
|
|
find_library(SFIZZ_LIBRARY NAMES sfizz)
|
|
if(NOT SFIZZ_INCLUDE_DIR OR NOT SFIZZ_LIBRARY)
|
|
message(FATAL_ERROR "sfizz not found — cai qua vcpkg: vcpkg install sfizz")
|
|
endif()
|
|
else()
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(FLUIDSYNTH REQUIRED fluidsynth)
|
|
pkg_check_modules(SFIZZ REQUIRED sfizz)
|
|
endif()
|
|
|
|
include_directories(
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
${FLUIDSYNTH_INCLUDE_DIRS}
|
|
${SFIZZ_INCLUDE_DIRS}
|
|
)
|
|
|
|
add_executable(daw_vst_bridge
|
|
src/main.cpp
|
|
src/NativeInstrumentEngine.cpp
|
|
src/SharedMemoryIPC.cpp
|
|
)
|
|
|
|
if(VST3_SDK_TARGET)
|
|
target_link_libraries(daw_vst_bridge PRIVATE ${VST3_SDK_TARGET})
|
|
endif()
|
|
if(WIN32)
|
|
target_link_libraries(daw_vst_bridge PRIVATE ${FLUIDSYNTH_LIBRARY} ${SFIZZ_LIBRARY})
|
|
# Required Windows libs
|
|
target_link_libraries(daw_vst_bridge PRIVATE winmm)
|
|
else()
|
|
target_link_libraries(daw_vst_bridge PRIVATE ${FLUIDSYNTH_LIBRARIES} ${SFIZZ_LIBRARIES})
|
|
endif()
|