0d22e8b4d3
JuceFxEngine: requestEditor/pumpEditorQueue/isEditorOpen/takeCapturedState, queue thread-safe, thuc thi tren GUI thread; shutdown() dong editor truoc graph.clear(); prepare() map slot->processor. juce_fx_bridge link juce_gui_basics; target juce_fx_selftest (khong ship) verify open/close/capture voi VST3 that — PASS tren Focusrite fast-compressor_x64. Tien de M2 (GUI thread + host window).
64 lines
2.3 KiB
CMake
64 lines
2.3 KiB
CMake
# native_bridge/juce_fx/CMakeLists.txt
|
|
# G1 POC: juce_fx_bridge.exe — JUCE AudioProcessorGraph thay RealtimeFxChain
|
|
# trong SHM realtime loop. Windows only. Build riêng (không chung với
|
|
# daw_vst_bridge) để JUCE không kéo opengl/fluidsynth vào bridge cũ.
|
|
cmake_minimum_required(VERSION 3.20)
|
|
project(juce_fx_bridge LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../JUCE/CMakeLists.txt")
|
|
message(FATAL_ERROR "JUCE submodule missing — run: git submodule update --init native_bridge/JUCE")
|
|
endif()
|
|
|
|
# JUCE framework (submodule, tag 8.0.7). add_subdirectory tạo targets
|
|
# juce::core, juce::audio_basics, juce::audio_processors, ...
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../JUCE JUCE EXCLUDE_FROM_ALL)
|
|
|
|
add_executable(juce_fx_bridge
|
|
main_juce_fx.cpp
|
|
JuceFxLoop.cpp
|
|
JuceFxEngine.cpp
|
|
)
|
|
target_include_directories(juce_fx_bridge PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
|
)
|
|
target_link_libraries(juce_fx_bridge PRIVATE
|
|
juce::juce_core
|
|
juce::juce_audio_basics
|
|
juce::juce_audio_processors
|
|
# M1 editor host: AudioProcessorEditor cần gui_basics (Component/MessageManager)
|
|
juce::juce_gui_basics
|
|
)
|
|
# G2: VST3 hosting — JUCE mặc định JUCE_PLUGINHOST_VST3=0, bật để
|
|
# VST3PluginFormat (findAllTypesForFile/createInstanceFromDescription/...)
|
|
# được compile (juce_audio_processors tự bundle VST3_SDK).
|
|
target_compile_definitions(juce_fx_bridge PRIVATE JUCE_PLUGINHOST_VST3=1)
|
|
if(WIN32)
|
|
# timeBeginPeriod (winmm) — như fx_vst_bridge
|
|
target_link_libraries(juce_fx_bridge PRIVATE winmm)
|
|
endif()
|
|
|
|
# ── M1 selftest (editor API — KHÔNG ship): verify editor host trên instance
|
|
# DSP thật trước khi M2 attach GUI thread. Chạy thủ công:
|
|
# build_juce/Release/juce_fx_selftest.exe "<path.vst3>"
|
|
add_executable(juce_fx_selftest
|
|
editor_selftest.cpp
|
|
JuceFxEngine.cpp
|
|
)
|
|
target_include_directories(juce_fx_selftest PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
|
)
|
|
target_link_libraries(juce_fx_selftest PRIVATE
|
|
juce::juce_core
|
|
juce::juce_audio_basics
|
|
juce::juce_audio_processors
|
|
juce::juce_gui_basics
|
|
)
|
|
target_compile_definitions(juce_fx_selftest PRIVATE JUCE_PLUGINHOST_VST3=1)
|
|
target_compile_definitions(juce_fx_selftest PRIVATE JUCE_MODAL_LOOPS_PERMITTED=1)
|
|
if(WIN32)
|
|
target_link_libraries(juce_fx_selftest PRIVATE winmm)
|
|
endif()
|