Skip to content

feat(sys): allow relocating the CMake build dirs via environment variables - #183

Open
LeonarddeR wants to merge 1 commit into
AllenDang:mainfrom
LeonarddeR:build-dir-overrides
Open

feat(sys): allow relocating the CMake build dirs via environment variables#183
LeonarddeR wants to merge 1 commit into
AllenDang:mainfrom
LeonarddeR:build-dir-overrides

Conversation

@LeonarddeR

Copy link
Copy Markdown
Contributor

Closes #182.

The build script compiles wxWidgets and the wrapper library through CMake. It writes both build trees to fixed directories at the profile level of cargo's target directory. The download location of the wxWidgets source is already configurable through the WXWIDGETS_DIR environment variable, but the two build directories are not configurable at all.

Continuous integration caches need these trees to be relocatable. The common Rust cache action cleans unrecognized directories out of the target directory before saving, so the fixed locations force a full wxWidgets rebuild on every CI run. Pointing the trees at a directory the cache preserves avoids that without consumers having to hard-code the crate's internal paths.

This change makes both directories configurable, following the pattern WXWIDGETS_DIR already established:

  • WXDRAGON_SYS_BUILD_DIR overrides the wrapper's build directory (default: wxdragon_sys_cmake_build).
  • WXWIDGETS_BUILD_DIR overrides the wxWidgets build directory (default: wxwidgets_cmake_build).

When a variable is unset, the previous location is used, so existing builds are unaffected.

The build script now also emits rerun-if-env-changed for all three variables, including the pre-existing WXWIDGETS_DIR, so changing one of them retriggers the build script instead of silently reusing the old location.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UZyiWydqoemtUSY5ZryoFB

…ables

WXDRAGON_SYS_BUILD_DIR and WXWIDGETS_BUILD_DIR override the two build
directories otherwise hardcoded at the profile level of the target
directory, mirroring the existing WXWIDGETS_DIR override for the
source. All three variables now emit rerun-if-env-changed so a change
retriggers the build script.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UZyiWydqoemtUSY5ZryoFB
@LeonarddeR
LeonarddeR marked this pull request as ready for review August 15, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow overriding the CMake build directories so CI caches can hold them

1 participant