# Building

M0 requires a Windows x64 developer environment with CMake 3.25+, Ninja, and a
C++20 MSVC compiler. Configure with `cmake --preset windows-x64-debug`.

## M2 FFmpeg metadata lab

The default Windows x64 build uses MSVC and does not link the MinGW-built M1 media artifacts. To enable the FFmpeg container inventory, use the matching MSYS2 UCRT64 toolchain:

```sh
export MSYSTEM=UCRT64
export PATH=/ucrt64/bin:/usr/bin:$PATH
cmake -S . -B build/ucrt64-ffmpeg -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DSMARTCUT_MEDIA_ROOT=/g/Documents/SmartCut64/artifacts/m1
cmake --build build/ucrt64-ffmpeg
./build/ucrt64-ffmpeg/smartcut-cli.exe metadata-lab --container \
  --input /path/to/input.mkv --output metadata-report.json
```

The report is `metadata-lab-container-v1` and records container format, stream codec parameters, packet count, packet side-data count, and codec side-data counts. The MSVC build must not be pointed at these MinGW import libraries; a native MSVC FFmpeg rebuild is required before enabling that combination.

## Non-interactive release gate

CI and handover runs can use the PowerShell gate without prompts:

```powershell
powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/release-gate.ps1
```

Success requires the UCRT GUI test suite and produces:

- `build/windows-ucrt-gui-release/test-results/gui-probe-contract.json`
- `build/windows-ucrt-gui-release/test-results/gui-probe-contract.json.release-summary.json`

The GUI integration fixture is checked in as base64 under `tests/fixtures` and
materialized into the preset build directory during configuration. The release
gate therefore does not rely on an ignored or pre-existing `build` artifact.
