Split CMakeLists.txt into cmake/Plugin.cmake (production formats and MinGW link flags) and cmake/Harness.cmake (console test harness with CTest registration). Add SERUMALT_BUILD_PLUGIN and SERUMALT_BUILD_TESTS options so production and harness builds are mutually exclusive and each omits the other's targets. Add build_linux.sh, build_macos.sh, and build_harness.sh with host validation, env-overridable build dirs, and explicit option flags. Rewrite build_windows.sh to use the checked-in mingw64-toolchain.cmake instead of regenerating it, validate all required tools, and stage with cmake -E copy_directory. Broaden .gitignore to cover all build_*/ directories.
53 lines
1.9 KiB
CMake
53 lines
1.9 KiB
CMake
# ---------------------------------------------------------------------------
|
|
# Plugin target
|
|
# ---------------------------------------------------------------------------
|
|
# JUCE 7.0.12 builds its VST3 manifest helper (juce_vst3_helper) with the same
|
|
# toolchain as the plugin itself. When cross-compiling, that produces a Windows
|
|
# .exe which cannot run on the Linux build host, so we disable the automatic
|
|
# manifest step and inject a Windows moduleinfo.json afterwards
|
|
# (see build_windows.sh). Native builds keep the automatic step.
|
|
set(SERUMALT_VST3_AUTO_MANIFEST TRUE)
|
|
if(CMAKE_CROSSCOMPILING)
|
|
set(SERUMALT_VST3_AUTO_MANIFEST FALSE)
|
|
endif()
|
|
|
|
set(SERUMALT_FORMATS VST3)
|
|
if(NOT WIN32)
|
|
list(APPEND SERUMALT_FORMATS Standalone)
|
|
endif()
|
|
if(APPLE)
|
|
list(APPEND SERUMALT_FORMATS AU)
|
|
endif()
|
|
|
|
juce_add_plugin(SerumAlt
|
|
VERSION ${PROJECT_VERSION}
|
|
COMPANY_NAME "SerumAlt Audio"
|
|
IS_SYNTH TRUE
|
|
NEEDS_MIDI_INPUT TRUE
|
|
NEEDS_MIDI_OUTPUT FALSE
|
|
IS_MIDI_EFFECT FALSE
|
|
EDITOR_WANTS_KEYBOARD_FOCUS FALSE
|
|
PLUGIN_MANUFACTURER_CODE Salt
|
|
PLUGIN_CODE Sera
|
|
BUNDLE_ID com.serumalt.SerumAlt
|
|
FORMATS ${SERUMALT_FORMATS}
|
|
PRODUCT_NAME "SerumAlt"
|
|
VST3_AUTO_MANIFEST ${SERUMALT_VST3_AUTO_MANIFEST})
|
|
|
|
serumalt_configure_target(SerumAlt)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# MinGW cross-build: static C++/threading runtime
|
|
# ---------------------------------------------------------------------------
|
|
# When cross-compiling for Windows with MinGW, link libgcc / libstdc++ /
|
|
# winpthread statically so the VST3 DLL is self-contained. Otherwise the DLL
|
|
# imports libgcc_s_seh-1.dll, libstdc++-6.dll and libwinpthread-1.dll, none of
|
|
# which ship with the bundle (or exist on a stock Windows host), so the host's
|
|
# scan would fail to load the plugin. Native (Linux) builds are unaffected.
|
|
if(MINGW)
|
|
target_link_options(SerumAlt_VST3 PRIVATE
|
|
-static-libgcc
|
|
-static-libstdc++
|
|
-static)
|
|
endif()
|