build(app): CMake presets, and warn when no librashader runtime will ship (#1132)

* build(app): CMake presets, and warn when no librashader runtime will ship

- `app/CMakePresets.json` adds three presets: release, debug and nightly (the nightly channel, where the emulation thread defaults on). Each builds in `app/build-<preset>/`. Run them from `app/`: `cmake --preset release && cmake --build --preset release -j`.
- VJ_APP_FETCH_LIBRASHADER can stay OFF in the cache from an earlier offline or packaging configure, and the default never comes back. Configure now warns about that where a prebuilt exists (Windows, Apple silicon). Otherwise a local build ships no runtime and the Shader section reports the library missing. Configure also names the prebuilt runtime it picked.
- Ignore `app/CMakeUserPresets.json`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* build(app): the release and debug presets set the dev channel

A cached VJ_BUILD_CHANNEL=nightly from an earlier -D survived the presets, which set no channel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Joe MattielloandClaude Opus 5.5 authored and GitHub committed 2026-11-01 01:30:53 -04:00
1 parent 7637eeda23
commit 4900c62dcc
4 files changed
+71

No files matched your search

+1
View File
@@ -210,3 +210,4 @@ test/roms/tier1/
# Standalone app (app/): CMake build trees
/app/build*/
/app/CMakeUserPresets.json
+42
View File
@@ -0,0 +1,42 @@
{
"version": 3,
"cmakeMinimumRequired": { "major": 3, "minor": 21, "patch": 0 },
"configurePresets": [
{
"name": "base",
"hidden": true,
"binaryDir": "${sourceDir}/build-${presetName}",
"cacheVariables": { "VJ_BUILD_CHANNEL": "dev" }
},
{
"name": "release",
"displayName": "Release (dev channel)",
"description": "Optimised local build: emulation thread off by default, like a release",
"inherits": "base",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }
},
{
"name": "debug",
"displayName": "Debug (dev channel)",
"inherits": "base",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
},
{
"name": "nightly",
"displayName": "Release (nightly channel)",
"description": "What the nightly builds ship: the emulation thread defaults on",
"inherits": "base",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release", "VJ_BUILD_CHANNEL": "nightly" }
}
],
"buildPresets": [
{ "name": "release", "configurePreset": "release", "configuration": "Release" },
{ "name": "debug", "configurePreset": "debug", "configuration": "Debug" },
{ "name": "nightly", "configurePreset": "nightly", "configuration": "Release" }
],
"testPresets": [
{ "name": "release", "configurePreset": "release", "configuration": "Release", "output": { "outputOnFailure": true } },
{ "name": "debug", "configurePreset": "debug", "configuration": "Debug", "output": { "outputOnFailure": true } },
{ "name": "nightly", "configurePreset": "nightly", "configuration": "Release", "output": { "outputOnFailure": true } }
]
}
+14
View File
@@ -30,6 +30,20 @@ ctest --test-dir app/build -C Release --output-on-failure # headless smoke tes
The binary is `app/build/virtualjaguar` (`app/build/Release/virtualjaguar.exe`
with the Visual Studio generator).
With CMake 3.21+ the same builds have names, run from `app/`:
```sh
cd app
cmake --preset release # or debug, or nightly (the nightly channel: emulation thread on by default)
cmake --build --preset release -j
ctest --preset release # headless smoke tests
```
Each preset builds in its own `app/build-<preset>/` and sets its build type and channel on every
configure. Any other `-D` option stays in the build directory's cache until you change it: an
earlier `-DVJ_APP_FETCH_LIBRASHADER=OFF` keeps the librashader runtime out of every later build,
and configure warns about that where a prebuilt exists.
`-DVJ_TV_DEFAULT=auto|manual|off` (default `auto`) is the TV mode setting a fresh config starts on, so a local build starts on Auto
while release packages are built with `manual` (see [TV mode](#tv-mode)).
+14
View File
@@ -159,12 +159,26 @@ elseif(VJ_APP_FETCH_LIBRASHADER)
endif()
if(EXISTS "${librashader_bin_SOURCE_DIR}/${_libname}")
set(VJ_LIBRASHADER_LIB_FILE "${librashader_bin_SOURCE_DIR}/${_libname}")
message(STATUS "librashader runtime: ${VJ_LIBRASHADER_LIB_FILE} (prebuilt ${_zip})")
else()
message(WARNING "librashader: ${_libname} not found in ${_zip}")
endif()
else()
message(STATUS "librashader: no prebuilt runtime is published for this platform; install it separately")
endif()
elseif(VJ_SHADERS_AVAILABLE)
# The cache keeps an OFF from an earlier offline or packaging configure, and the default never
# comes back: say so where a download exists (Windows, Apple silicon), or a local build quietly
# ships no runtime and the Shader section reports the library missing.
set(_arch "${CMAKE_OSX_ARCHITECTURES}")
if(NOT _arch)
set(_arch "${CMAKE_SYSTEM_PROCESSOR}")
endif()
if(WIN32 OR (APPLE AND _arch MATCHES "arm64|aarch64"))
message(WARNING "librashader: VJ_APP_FETCH_LIBRASHADER is OFF and VJ_LIBRASHADER_LIB is unset, so no runtime "
"is copied beside the executable; shaders then need a system copy or VJ_LIBRASHADER. "
"Configure again with -DVJ_APP_FETCH_LIBRASHADER=ON to download the pinned prebuilt.")
endif()
endif()
# ---- bundled slang-shaders subset -------------------------------------------------------