90 lines
3.3 KiB
CMake
90 lines
3.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
|
|
JuceFxGuiHost.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)
|
|
# M2 GUI thread: runDispatchLoopUntil cần modal loops được phép
|
|
target_compile_definitions(juce_fx_bridge PRIVATE JUCE_MODAL_LOOPS_PERMITTED=1)
|
|
if(WIN32)
|
|
# timeBeginPeriod (winmm) + MMCSS AvSetMmThreadCharacteristics (avrt)
|
|
target_link_libraries(juce_fx_bridge PRIVATE winmm avrt)
|
|
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()
|
|
|
|
# ── M2 gui selftest (GUI thread + host window — KHÔNG ship): verify host
|
|
# window trên instance DSP thật, không SHM:
|
|
# build_juce/Release/juce_fx_gui_selftest.exe "<path.vst3>"
|
|
add_executable(juce_fx_gui_selftest
|
|
gui_host_selftest.cpp
|
|
JuceFxEngine.cpp
|
|
JuceFxGuiHost.cpp
|
|
)
|
|
target_include_directories(juce_fx_gui_selftest PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
|
)
|
|
target_link_libraries(juce_fx_gui_selftest PRIVATE
|
|
juce::juce_core
|
|
juce::juce_audio_basics
|
|
juce::juce_audio_processors
|
|
juce::juce_gui_basics
|
|
)
|
|
target_compile_definitions(juce_fx_gui_selftest PRIVATE JUCE_PLUGINHOST_VST3=1)
|
|
target_compile_definitions(juce_fx_gui_selftest PRIVATE JUCE_MODAL_LOOPS_PERMITTED=1)
|
|
if(WIN32)
|
|
target_link_libraries(juce_fx_gui_selftest PRIVATE winmm)
|
|
endif()
|