build(cmake): add a dragonx_release target that builds only what ships

Release builds ran a plain `cmake --build .`, which builds `all`: on top
of the app and the wallet-rebuild helper, every --*-release run also
compiled HushChatFixtureCheck, ObsidianDragonTests where BUILD_TESTING
is on (Linux, macOS) and, in Lite backend trees, lite_smoke and
lite_send_smoke. None of them ship.

A new `dragonx_release` custom target depends on ObsidianDragon plus
dragonx-wallet-rebuild, copy_langs and copy_themes where those targets
exist, and the three release paths in build.sh build only that target.
The dev build (./build.sh) still builds `all`.

BUILD_TESTING is deliberately left alone: release and dev builds share
build/<platform>, and writing BUILD_TESTING=OFF into that cache would
leave ctest running a stale test binary.

Measured:
- a dry run of dragonx_release schedules none of the test, smoke-tool or
  fixture-CLI builds that `all` schedules, in a full-node, a
  Lite+backend and a mingw tree; the wallet-rebuild helper is still
  built;
- all four release builds (Linux and Windows, full node and Lite) log
  the dragonx_release target and no ObsidianDragonTests build, and the
  Linux zip and AppImage file lists are unchanged.

Consequences: a release run no longer refreshes the test binary or the
lite smoke tools in build/<platform>/bin, so run ./build.sh or
`cmake --build` before ctest, and build the Windows smoke tools with
`--target lite_smoke lite_send_smoke`. If a release step starts copying
another CMake-built file out of bin/, its target must be added to
dragonx_release.

Not verifiable here: macOS --mac-release (the .app should still contain
the app, dragonx-wallet-rebuild and Contents/Resources/res).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 06:05:07 -05:00
co-authored by Claude Opus 5.5
parent 25ceb2cfe1
commit e65be1d24b
2 changed files with 16 additions and 3 deletions
+13
View File
@@ -1139,6 +1139,19 @@ else()
message(STATUS "wallet-rebuild helper: OFF (no Berkeley DB found; set DRAGONX_BDB_ROOT for release builds)") message(STATUS "wallet-rebuild helper: OFF (no Berkeley DB found; set DRAGONX_BDB_ROOT for release builds)")
endif() endif()
# Release packaging (build.sh --linux-release / --win-release / --mac-release) builds ONLY what ships:
# cmake --build . --target dragonx_release
# The test binary, the lite smoke tools and the dev CLIs are skipped WITHOUT writing BUILD_TESTING=OFF into the
# build/<platform> cache that dev builds share. A stale OFF would leave ctest running an old test binary.
# If a release path starts copying a new CMake-built file out of bin/, add its target here.
add_custom_target(dragonx_release)
add_dependencies(dragonx_release ObsidianDragon)
foreach(_dragonx_release_dep dragonx-wallet-rebuild copy_langs copy_themes)
if(TARGET ${_dragonx_release_dep})
add_dependencies(dragonx_release ${_dragonx_release_dep})
endif()
endforeach()
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# fake_dragonxd — a deliberately slow, scriptable dragonxd stand-in that reproduces the daemon-stop # fake_dragonxd — a deliberately slow, scriptable dragonxd stand-in that reproduces the daemon-stop
# incident (usage and the incident it models: tools/fake_dragonxd/README.md). # incident (usage and the incident it models: tools/fake_dragonxd/README.md).
+3 -3
View File
@@ -393,7 +393,7 @@ build_release_linux() {
"${CMAKE_LITE_ARGS[@]}" "${CMAKE_LITE_ARGS[@]}"
info "Building with $JOBS jobs ..." info "Building with $JOBS jobs ..."
cmake --build . -j "$JOBS" cmake --build . -j "$JOBS" --target dragonx_release
[[ -f "bin/${APP_BASENAME}" ]] || { err "Linux build failed"; exit 1; } [[ -f "bin/${APP_BASENAME}" ]] || { err "Linux build failed"; exit 1; }
@@ -854,7 +854,7 @@ HDR
"${CMAKE_LITE_ARGS[@]}" "${CMAKE_LITE_ARGS[@]}"
info "Building with $JOBS jobs ..." info "Building with $JOBS jobs ..."
cmake --build . -j "$JOBS" cmake --build . -j "$JOBS" --target dragonx_release
[[ -f "bin/${APP_BASENAME}.exe" ]] || { err "Windows build failed"; exit 1; } [[ -f "bin/${APP_BASENAME}.exe" ]] || { err "Windows build failed"; exit 1; }
# Strip the app exe — the Linux and macOS release paths already strip theirs, and even the Windows # Strip the app exe — the Linux and macOS release paths already strip theirs, and even the Windows
@@ -1150,7 +1150,7 @@ TOOLCHAIN
fi fi
info "Building with $JOBS jobs ..." info "Building with $JOBS jobs ..."
cmake --build . -j "$JOBS" cmake --build . -j "$JOBS" --target dragonx_release
[[ -f "bin/${APP_BASENAME}" ]] || { err "macOS build failed"; exit 1; } [[ -f "bin/${APP_BASENAME}" ]] || { err "macOS build failed"; exit 1; }