chore: move build output under build/ and scripts into scripts/
Layout: - scripts/ holds the four build scripts plus the new clean.sh - cmake/ holds mingw64-toolchain.cmake - the scripts default to build/linux, build/macos, build/windows, build/harness - docs/ holds the audit documents, with the round 1 task list archived Cleanup: - scripts/clean.sh removes generated output, with --dry-run, --staging, --legacy and --all, and refuses tracked, protected or outside paths - the Windows VST3 manifest now comes from cmake/moduleinfo.json.in, so its version, vendor and class IDs follow cmake/Plugin.cmake instead of a hand-written heredoc that could drift - deleted the unused Source/GUI/Slider, which no code constructed - fixed the hidden double processBlock overload: three warning lines to zero - unslopped the build scripts, the two .cjs helpers and the CMake comments - .gitignore covers the upstream JUCE Projucer and DemoRunner binaries Verified: five scripts pass bash -n; the harness passes CTest with zero warning lines; the Linux VST3 and Standalone link; the Windows cross-build passes its x86-64, runtime-import and entry-point checks; each configure exposes only its own targets; and a full build leaves Source/ and third_party/JUCE unchanged. The generated manifest is identical to the previous hand-written one.
This commit is contained in:
1 parent
e4cea300db
commit
facd5c5b5e
25 files changed
+438
-313
No files matched your search
@@ -74,14 +74,15 @@ keeps its previous settings if an edit is still in progress.
|
||||
|
||||
## Building
|
||||
|
||||
Each script configures and builds its own directory. Production builds disable the
|
||||
QA harness explicitly; the harness script creates no plugin or standalone targets.
|
||||
JUCE 7.0.12 is vendored under `third_party/JUCE` and is not downloaded by the scripts.
|
||||
The scripts live in `scripts/`. Each configures and builds its own directory under
|
||||
`build/`. Production builds disable the QA harness explicitly; the harness script
|
||||
creates no plugin or standalone targets. JUCE 7.0.12 is vendored under
|
||||
`third_party/JUCE` and is not downloaded by the scripts.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
All scripts require Bash, CMake 3.22+, Ninja, and C/C++17 compilers. The harness
|
||||
also uses CTest, included with CMake, when invoked with `--run`.
|
||||
The build scripts require Bash, CMake 3.22+, Ninja, and C/C++17 compilers. The
|
||||
harness script also uses CTest, included with CMake, when invoked with `--run`.
|
||||
|
||||
On Linux, install GCC or Clang, `pkg-config`, and the ALSA, FreeType, X11 and OpenGL
|
||||
development libraries. For Debian/Ubuntu:
|
||||
@@ -120,40 +121,42 @@ sudo apt install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x8
|
||||
|
||||
On Arch/CachyOS, use `sudo pacman -S --needed mingw-w64-gcc` instead. Keep the
|
||||
native Linux tools and libraries installed: JUCE builds `juceaide` for the host
|
||||
before compiling the Windows plugin. The checked-in `mingw64-toolchain.cmake`
|
||||
before compiling the Windows plugin. The checked-in `cmake/mingw64-toolchain.cmake`
|
||||
selects the `x86_64-w64-mingw32-*` tools and isolates target library searches.
|
||||
|
||||
### Production builds
|
||||
|
||||
| Host | Command | Build directory | Formats |
|
||||
| --- | --- | --- | --- |
|
||||
| Linux | `./build_linux.sh` | `build_linux/` | VST3, Standalone |
|
||||
| macOS | `./build_macos.sh` | `build_macos/` | VST3, AU, Standalone |
|
||||
| Linux targeting Windows x64 | `./build_windows.sh` | `build_windows/` | VST3 only |
|
||||
| Linux | `./scripts/build_linux.sh` | `build/linux/` | VST3, Standalone |
|
||||
| macOS | `./scripts/build_macos.sh` | `build/macos/` | VST3, AU, Standalone |
|
||||
| Linux targeting Windows x64 | `./scripts/build_windows.sh` | `build/windows/` | VST3 only |
|
||||
|
||||
Default Release artifacts:
|
||||
|
||||
- Linux: `build_linux/SerumAlt_artefacts/Release/VST3/SerumAlt.vst3` and
|
||||
`build_linux/SerumAlt_artefacts/Release/Standalone/SerumAlt`.
|
||||
- macOS: `build_macos/SerumAlt_artefacts/Release/VST3/SerumAlt.vst3`,
|
||||
`build_macos/SerumAlt_artefacts/Release/AU/SerumAlt.component`, and
|
||||
`build_macos/SerumAlt_artefacts/Release/Standalone/SerumAlt.app`.
|
||||
- Windows: `build_windows/SerumAlt_artefacts/Release/VST3/SerumAlt.vst3`, also
|
||||
- Linux: `build/linux/SerumAlt_artefacts/Release/VST3/SerumAlt.vst3` and
|
||||
`build/linux/SerumAlt_artefacts/Release/Standalone/SerumAlt`.
|
||||
- macOS: `build/macos/SerumAlt_artefacts/Release/VST3/SerumAlt.vst3`,
|
||||
`build/macos/SerumAlt_artefacts/Release/AU/SerumAlt.component`, and
|
||||
`build/macos/SerumAlt_artefacts/Release/Standalone/SerumAlt.app`.
|
||||
- Windows: `build/windows/SerumAlt_artefacts/Release/VST3/SerumAlt.vst3`, also
|
||||
copied to `SerumAlt_Windows/SerumAlt.vst3`.
|
||||
|
||||
The Windows script reuses the toolchain file without rewriting it. It injects
|
||||
`moduleinfo.json` because the cross-compiled JUCE manifest helper cannot run on
|
||||
Linux. Keep this manifest's metadata in sync with `CMakeLists.txt`,
|
||||
`cmake/Plugin.cmake`, and the vendored VST3 SDK. MinGW links its C++ and threading
|
||||
runtimes statically via `-static-libgcc -static-libstdc++ -static`. Before staging,
|
||||
the script verifies the linked module is x86-64, imports none of those MinGW
|
||||
runtimes, and exports the VST3 entry points, so a module that a stock Windows host
|
||||
could not load fails the build instead of being staged silently.
|
||||
The Windows script reuses the toolchain file without rewriting it. A cross-build
|
||||
cannot run JUCE's manifest helper, because that helper is a host tool, so the
|
||||
script copies the `moduleinfo.json` that CMake writes from
|
||||
`cmake/moduleinfo.json.in`. The plugin name, version, vendor, class IDs and VST3
|
||||
SDK version come from variables in `cmake/Plugin.cmake`, so a version bump reaches
|
||||
the manifest on its own. MinGW links its C++ and threading runtimes statically via
|
||||
`-static-libgcc -static-libstdc++ -static`. Before staging, the script verifies the
|
||||
linked module is x86-64, imports none of those MinGW runtimes, and exports the VST3
|
||||
entry points, so a module that a stock Windows host could not load fails the build
|
||||
instead of being staged silently.
|
||||
|
||||
macOS builds target the host architecture by default. To request a universal binary:
|
||||
|
||||
```bash
|
||||
CMAKE_OSX_ARCHITECTURES='arm64;x86_64' ./build_macos.sh
|
||||
CMAKE_OSX_ARCHITECTURES='arm64;x86_64' ./scripts/build_macos.sh
|
||||
```
|
||||
|
||||
`CMAKE_OSX_DEPLOYMENT_TARGET` can also be passed to that script. Architecture and
|
||||
@@ -166,22 +169,22 @@ and do not install plugins into a DAW's plugin directories.
|
||||
On Linux or macOS, build the console harness without production targets:
|
||||
|
||||
```bash
|
||||
./build_harness.sh
|
||||
./scripts/build_harness.sh
|
||||
```
|
||||
|
||||
Build and run the checks:
|
||||
|
||||
```bash
|
||||
./build_harness.sh --run
|
||||
./scripts/build_harness.sh --run
|
||||
```
|
||||
|
||||
Or rerun an already-built Release harness:
|
||||
|
||||
```bash
|
||||
ctest --test-dir build_harness --build-config Release --output-on-failure --no-tests=error
|
||||
ctest --test-dir build/harness --build-config Release --output-on-failure --no-tests=error
|
||||
```
|
||||
|
||||
The executable is `build_harness/SerumAltTest_artefacts/Release/SerumAltTest`.
|
||||
The executable is `build/harness/SerumAltTest_artefacts/Release/SerumAltTest`.
|
||||
It renders the initial state and every factory preset, checks for non-finite
|
||||
samples and aggregate non-silence, and exercises the RAVE toggle. A failed check
|
||||
returns a nonzero exit status. This is a processor integration smoke test, not a
|
||||
@@ -204,8 +207,8 @@ library. It is built and run natively, not as a Windows cross-compiled executabl
|
||||
For example:
|
||||
|
||||
```bash
|
||||
BUILD_TYPE=Debug BUILD_DIR=build_harness_debug ./build_harness.sh --run
|
||||
CMAKE_BUILD_PARALLEL_LEVEL=4 ./build_linux.sh
|
||||
BUILD_TYPE=Debug BUILD_DIR=build/harness_debug ./scripts/build_harness.sh --run
|
||||
CMAKE_BUILD_PARALLEL_LEVEL=4 ./scripts/build_linux.sh
|
||||
```
|
||||
|
||||
`CMakeLists.txt` owns the shared source list and target configuration.
|
||||
@@ -216,9 +219,9 @@ For direct CMake use, `SERUMALT_BUILD_PLUGIN` defaults to `ON` and
|
||||
`SERUMALT_BUILD_TESTS` defaults to `OFF`. A harness-only configure is:
|
||||
|
||||
```bash
|
||||
cmake -S . -B build_harness -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
||||
cmake -S . -B build/harness -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
||||
-DSERUMALT_BUILD_PLUGIN=OFF -DSERUMALT_BUILD_TESTS=ON
|
||||
cmake --build build_harness --target SerumAltTest
|
||||
cmake --build build/harness --target SerumAltTest
|
||||
```
|
||||
|
||||
An existing CMake cache retains its old option values; changing the defaults does
|
||||
@@ -229,12 +232,11 @@ when configuring directly with CMake.
|
||||
### Fresh builds
|
||||
|
||||
The scripts reuse their build directories without deleting files, resetting Git,
|
||||
or installing packages. Generated `build/`, `build_*/`, and `SerumAlt_Windows/`
|
||||
directories are git-ignored. Leave existing builds intact and select an unused
|
||||
build directory for a fresh configure:
|
||||
or installing packages. `build/` and `SerumAlt_Windows/` are git-ignored. Leave
|
||||
existing builds intact and select an unused build directory for a fresh configure:
|
||||
|
||||
```bash
|
||||
BUILD_DIR=build_linux_fresh ./build_linux.sh
|
||||
BUILD_DIR=build/linux_fresh ./scripts/build_linux.sh
|
||||
```
|
||||
|
||||
Windows staging updates generated files without deleting extra files already in
|
||||
@@ -242,9 +244,27 @@ the destination. For a clean distribution bundle, choose unused build and output
|
||||
paths together:
|
||||
|
||||
```bash
|
||||
BUILD_DIR=build_windows_fresh OUTPUT_DIR=build_windows_fresh/staged ./build_windows.sh
|
||||
BUILD_DIR=build/windows_fresh OUTPUT_DIR=build/windows_fresh/staged ./scripts/build_windows.sh
|
||||
```
|
||||
|
||||
### Cleaning
|
||||
|
||||
`scripts/clean.sh` removes generated output. A plain run removes the build trees
|
||||
under `build/`; `--staging` adds `SerumAlt_Windows/`, `--legacy` adds the
|
||||
`build_*` and `cmake-build-*` trees that earlier versions of the scripts left in
|
||||
the repository root, and `--all` is both. `--dry-run` prints every path with its
|
||||
size and removes nothing.
|
||||
|
||||
```bash
|
||||
./scripts/clean.sh --dry-run --all
|
||||
./scripts/clean.sh --all
|
||||
```
|
||||
|
||||
The script never removes a tracked file, anything under `Source/`, `third_party/`
|
||||
or `.git`, or a path outside the repository. It refuses to run when `BUILD_DIR` or
|
||||
`OUTPUT_DIR` names a directory outside the repository, because such a directory
|
||||
belongs to another checkout.
|
||||
|
||||
## License
|
||||
|
||||
JUCE is licensed separately (see `third_party/JUCE/LICENSE.md`). This project is
|
||||
|
||||
Reference in new issue
Block a user