Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 43 additions & 28 deletions .claude/skills/build-cmake/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ Use this skill when the user wants to build their plugin project using CMake.

The project uses CMake presets for standardized builds. Prefer `--preset` instead of manual `-G` flags.

`CMakePresets.json` lives at the repo root, so presets are only visible when
configuring the root — `--preset` and `-S [ProjectName]` cannot be combined. The
root `CMakeLists.txt` decides which project is built (`add_subdirectory`). To
build a project it doesn't reference, configure that directory directly with an
explicit generator, e.g.:

```bash
cmake -S TemplateProjectWebView -B build/webview -G "Visual Studio 17 2022" -A x64
cmake --build build/webview --config Release
```

### List Available Presets

```bash
Expand All @@ -28,29 +39,27 @@ cmake --list-presets

```bash
# Configure with Ninja (fast builds)
cmake --preset macos-ninja -S [ProjectName]

# Build
cmake --preset macos-ninja
cmake --build build/macos-ninja --target [ProjectName]-app

# Or with Xcode (for debugging)
cmake --preset macos-xcode -S [ProjectName]
cmake --preset macos-xcode
cmake --build build/macos-xcode --config Release --target [ProjectName]-app

# Universal binary (arm64 + x86_64)
cmake --preset macos-xcode-universal -S [ProjectName]
cmake --preset macos-xcode-universal
cmake --build build/macos-xcode-universal --config Release
```

### iOS Builds

```bash
# iOS Device
cmake --preset ios-xcode -S [ProjectName]
cmake --preset ios-xcode
cmake --build build/ios-xcode --config Release

# iOS Simulator
cmake --preset ios-sim-xcode -S [ProjectName]
cmake --preset ios-sim-xcode
cmake --build build/ios-sim-xcode --config Release
```

Expand All @@ -60,40 +69,44 @@ For running in Simulator, use the `run-ios-simulator` skill.

```bash
# visionOS Device
cmake --preset visionos-xcode -S [ProjectName]
cmake --preset visionos-xcode
cmake --build build/visionos-xcode --config Release

# visionOS Simulator
cmake --preset visionos-sim-xcode -S [ProjectName]
cmake --preset visionos-sim-xcode
cmake --build build/visionos-sim-xcode --config Release
```

### Windows Builds

```bash
# Visual Studio 2022 (x64)
cmake --preset windows-vs2022 -S [ProjectName]
cmake --build build/windows-vs2022 --config Release
# Newest installed Visual Studio (x64)
cmake --preset windows
cmake --build build/windows --config Release

# ARM64EC
cmake --preset windows-vs2022-arm64ec -S [ProjectName]
cmake --build build/windows-vs2022-arm64ec --config Release
cmake --preset windows-arm64ec
cmake --build build/windows-arm64ec --config Release
```

### Web/WAM Build (Emscripten)
`windows` / `windows-arm64ec` do not pin a generator, so they pick up whichever
Visual Studio is installed (2022, 2026, …). Use `windows-vs2022` to pin VS2022
explicitly.

### Web Builds (Emscripten)

```bash
# Configure (requires EMSDK environment)
cmake --preset wam -S [ProjectName]
cmake --preset web

# Build
cmake --build build/wam --target [ProjectName]-wam
# WAM (AudioWorklet) distribution
cmake --build build/web --target [ProjectName]-wam-dist

# Create distribution
cmake --build build/wam --target [ProjectName]-wam-dist
# WASM (ScriptProcessor) distribution
cmake --build build/web --target [ProjectName]-wasm-dist
```

Output in `build/wam/out/[ProjectName]-wam/`
Output in `build/web/out/[ProjectName]/`

## Available Configure Presets

Expand All @@ -107,10 +120,12 @@ Output in `build/wam/out/[ProjectName]-wam/`
| `ios-sim-xcode` | iOS | Xcode | iOS Simulator builds |
| `visionos-xcode` | visionOS | Xcode | visionOS device builds |
| `visionos-sim-xcode` | visionOS | Xcode | visionOS Simulator builds |
| `windows` | Windows | newest VS | Windows x64 builds (default) |
| `windows-arm64ec` | Windows | newest VS | Windows ARM64EC builds |
| `windows-ninja` | Windows | Ninja | Fast Windows command-line builds |
| `windows-vs2022` | Windows | VS2022 | Windows x64 builds |
| `windows-vs2022-arm64ec` | Windows | VS2022 | Windows ARM64EC builds |
| `wam` | Web | Ninja | Emscripten/WebAssembly builds |
| `windows-vs2022` | Windows | VS2022 | Windows x64 builds, VS2022 pinned |
| `windows-vs2022-arm64ec` | Windows | VS2022 | Windows ARM64EC builds, VS2022 pinned |
| `web` | Web | Ninja | Emscripten/WebAssembly builds |

## Available Targets

Expand All @@ -130,7 +145,7 @@ Default configuration uses NanoVG with Metal (macOS/iOS) or GL2 (Windows).
To use Skia backend, add cache variables:

```bash
cmake --preset macos-ninja -S [ProjectName] \
cmake --preset macos-ninja \
-DIGRAPHICS_BACKEND=SKIA \
-DIGRAPHICS_RENDERER=METAL
```
Expand All @@ -156,20 +171,20 @@ Valid combinations:
```bash
# Remove build directory and reconfigure
rm -rf build/macos-ninja
cmake --preset macos-ninja -S [ProjectName]
cmake --preset macos-ninja
```

## Example

```bash
# Quick build of standalone app
cmake --preset macos-ninja -S MySynth
cmake --preset macos-ninja
cmake --build build/macos-ninja --target MySynth-app

# Open the built app
open ~/Applications/MySynth.app

# Build for iOS Simulator
cmake --preset ios-sim-xcode -S MySynth
cmake --preset ios-sim-xcode
cmake --build build/ios-sim-xcode --config Release
```
33 changes: 23 additions & 10 deletions .claude/skills/new-plugin/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,40 @@ Use this skill when the user wants to create a new plugin project in this out-of
2. **Check for existing projects:**
- If other project folders exist besides TemplateProject, ask if user wants to continue with existing work or create new

3. **Run duplicate script:**
3. **Choose a template and run the duplicate script:**

| Template | Use for |
|---|---|
| `TemplateProject` | A plugin with an IGraphics (C++) UI |
| `TemplateProjectWebView` | A plugin with a WebView (HTML/CSS/JS) UI |
| `TemplateProjectReaperExtensionWebView` | A REAPER extension with a WebView UI |

```bash
./duplicate.py TemplateProject [PluginName] [ManufacturerName]
./duplicate.py [Template] [PluginName] [ManufacturerName]
```

This touches only the new project. Add `--rewrite-root` to also repoint the repo's
`bump_version.py`, `CMakeLists.txt`, `.vscode/` and `.github/` at it — appropriate when
this repo is becoming the plugin's own repo. Add a fourth positional argument to create
the project outside this repo.

4. **Offer config.h customization:**
- `PLUG_UNIQUE_ID` - Verify the auto-generated 4-char ID
- `PLUG_UNIQUE_ID` - Verify the auto-generated 4-char ID (not present for a REAPER extension)
- `PLUG_MFR_ID` - Set manufacturer's 4-char ID
- Copyright, URLs - allow skipping for later

5. **Ask about committing:**
```bash
git add [PluginName]/*
git add .vscode/*
git add .github/*
git add bump_version.py
git commit -m "created [PluginName] based on TemplateProject"
git commit -m "created [PluginName] based on [Template]"
```
Also stage `.vscode/*`, `.github/*` and `bump_version.py` if `--rewrite-root` was used;
otherwise those files are unchanged.

6. **Next steps:**
- Open in Xcode: `open [PluginName]/[PluginName].xcworkspace`
- Build: Use the `build` skill from iPlug2
- Open in Xcode: `open [PluginName]/[PluginName].xcworkspace` (IGraphics template only —
the CMake-only templates have no xcworkspace; configure with CMake instead)
- Build: Use the `build` skill, or `build-cmake` for the CMake-only templates
- Setup SDKs: Use the `setup-deps` skill if needed

## Example
Expand All @@ -46,4 +58,5 @@ Use this skill when the user wants to create a new plugin project in this out-of
./duplicate.py TemplateProject MySynth MyBrand
```

Creates `MySynth/` with all project files configured and ready to build.
Creates `MySynth/` with all project files configured and ready to build. Run `./duplicate.py`
with no arguments to be prompted for the template, name and manufacturer instead.
97 changes: 77 additions & 20 deletions .github/workflows/build-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ jobs:
if-no-files-found: warn

# ==========================================================================
# Windows - Visual Studio 2022 (Default)
# Windows - Visual Studio (Default)
# ==========================================================================
windows-vs2022:
name: Windows (VS2022)
windows:
name: Windows (Visual Studio)
needs: parse-commands
if: needs.parse-commands.outputs.should_run == 'true'
runs-on: windows-latest
Expand Down Expand Up @@ -221,28 +221,85 @@ jobs:
./download-iplug-sdks.sh

- name: CMake Configure
run: cmake --preset=windows-vs2022
run: cmake --preset=windows

- name: Build
run: cmake --build --preset=windows-vs2022
run: cmake --build --preset=windows

- name: Verify Bundles
shell: pwsh
run: |
if (!(Test-Path "build\windows-vs2022\out\${{env.PROJECT_NAME}}.exe")) { exit 1 }
if (!(Test-Path "build\windows-vs2022\out\${{env.PROJECT_NAME}}.vst3")) { exit 1 }
if (!(Test-Path "build\windows-vs2022\out\${{env.PROJECT_NAME}}.clap")) { exit 1 }
if (!(Test-Path "build\windows\out\${{env.PROJECT_NAME}}.exe")) { exit 1 }
if (!(Test-Path "build\windows\out\${{env.PROJECT_NAME}}.vst3")) { exit 1 }
if (!(Test-Path "build\windows\out\${{env.PROJECT_NAME}}.clap")) { exit 1 }
echo "All bundles exist"

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows-vs2022-artifacts
path: build/windows-vs2022/out/
name: windows-artifacts
path: build/windows/out/
if-no-files-found: warn

# ==========================================================================
# Windows - Visual Studio 2022 ARM64EC - Optional: /ci arm64ec
# Windows - the other templates
#
# The root CMakeLists.txt only references PROJECT_NAME, so these are
# configured directly. No --preset: CMakePresets.json lives at the repo root
# and presets are read from the source directory. Omitting -G picks the
# newest installed Visual Studio.
# ==========================================================================
windows-templates:
name: Windows (${{ matrix.template }})
needs: parse-commands
if: needs.parse-commands.outputs.should_run == 'true'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- template: TemplateProjectWebView
artifact: TemplateProjectWebView.exe
- template: TemplateProjectReaperExtensionWebView
artifact: reaper_TemplateProjectReaperExtensionWebView.dll
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.parse-commands.outputs.pr_sha || github.sha }}
submodules: recursive

- name: Cache IPlug SDKs
id: cache-sdks
uses: actions/cache@v4
with:
path: |
iPlug2/Dependencies/IPlug/VST3_SDK
iPlug2/Dependencies/IPlug/CLAP_SDK
iPlug2/Dependencies/IPlug/CLAP_HELPERS
key: iplug-sdks-${{ hashFiles('iPlug2/Dependencies/IPlug/download-iplug-sdks.sh') }}

- name: Get SDKs
if: steps.cache-sdks.outputs.cache-hit != 'true'
shell: bash
run: |
cd iPlug2/Dependencies/IPlug
./download-iplug-sdks.sh

- name: CMake Configure
run: cmake -S ${{ matrix.template }} -B build/${{ matrix.template }} -A x64

- name: Build
run: cmake --build build/${{ matrix.template }} --config Release

- name: Verify Output
shell: pwsh
run: |
if (!(Test-Path "build\${{ matrix.template }}\out\${{ matrix.artifact }}")) { exit 1 }
echo "${{ matrix.artifact }} exists"

# ==========================================================================
# Windows - Visual Studio ARM64EC - Optional: /ci arm64ec
# ==========================================================================
windows-arm64ec:
name: Windows (ARM64EC)
Expand Down Expand Up @@ -274,24 +331,24 @@ jobs:
./download-iplug-sdks.sh

- name: CMake Configure
run: cmake --preset=windows-vs2022-arm64ec
run: cmake --preset=windows-arm64ec

- name: Build
run: cmake --build --preset=windows-vs2022-arm64ec
run: cmake --build --preset=windows-arm64ec

- name: Verify Bundles
shell: pwsh
run: |
if (!(Test-Path "build\windows-vs2022-arm64ec\out\${{env.PROJECT_NAME}}.exe")) { exit 1 }
if (!(Test-Path "build\windows-vs2022-arm64ec\out\${{env.PROJECT_NAME}}.vst3")) { exit 1 }
if (!(Test-Path "build\windows-vs2022-arm64ec\out\${{env.PROJECT_NAME}}.clap")) { exit 1 }
if (!(Test-Path "build\windows-arm64ec\out\${{env.PROJECT_NAME}}.exe")) { exit 1 }
if (!(Test-Path "build\windows-arm64ec\out\${{env.PROJECT_NAME}}.vst3")) { exit 1 }
if (!(Test-Path "build\windows-arm64ec\out\${{env.PROJECT_NAME}}.clap")) { exit 1 }
echo "All bundles exist"

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows-arm64ec-artifacts
path: build/windows-vs2022-arm64ec/out/
path: build/windows-arm64ec/out/
if-no-files-found: warn

# ==========================================================================
Expand Down Expand Up @@ -601,17 +658,17 @@ jobs:

- name: CMake Configure
run: |
cmake --preset=windows-vs2022 `
cmake --preset=windows `
-DIGRAPHICS_BACKEND=${{ matrix.backend }} `
-DIGRAPHICS_RENDERER=${{ matrix.renderer }}

- name: Build
run: cmake --build build/windows-vs2022 --config Release --target ${{env.PROJECT_NAME}}-app
run: cmake --build build/windows --config Release --target ${{env.PROJECT_NAME}}-app

- name: Verify App
shell: pwsh
run: |
if (!(Test-Path "build\windows-vs2022\out\${{env.PROJECT_NAME}}.exe")) { exit 1 }
if (!(Test-Path "build\windows\out\${{env.PROJECT_NAME}}.exe")) { exit 1 }
echo "${{ matrix.backend }}/${{ matrix.renderer }} build successful"

# ==========================================================================
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
xcuserdata
*.RPP-bak
*/build-*/
# CMake build trees (CMakePresets.json puts them under build/<preset>)
/build/
*.ipch
*.db
*.suo
Expand Down
Loading
Loading