From 31718bdc4f2653e8009fc08e51335a412592a60e Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 26 Aug 2026 23:00:47 +0200 Subject: [PATCH] Test build out of tree --- AGENTS.md | 6 +++--- configure.windows-x64 | 3 ++- configure.windows-x86 | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d1467647..c9c64cb7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,10 +81,10 @@ SnapRAID is designed to recover from an interruption, including `SIGKILL`, at an - `linux.cfg`: Code formatting rules for `raid/` directory and its subdirectories - Run `make doc` to regenerate all manual pages (`*.1`) and text manuals (`*.txt`) - Always use parallel compilation with `make -j$(nproc)` instead of plain `make` -- To cross-compile for Windows x64: run `make clean && ./configure.windows-x64 && make -j$(nproc)` +- To cross-compile for Windows x64: build out-of-tree in `/tmp` so the Linux configuration is preserved: + `mkdir -p /tmp/snapraid-windows && (cd /tmp/snapraid-windows && /path/to/configure.windows-x64 && make -j$(nproc))` + Subsequent Windows rebuilds only require: `(cd /tmp/snapraid-windows && make -j$(nproc))` - The Windows build needs to be tested only when modifying Windows-specific code (e.g., `os/mingw.*`, `cmdline/mingwapp.c`, or Windows-specific `#ifdef` paths) -- After configuring for Windows (`./configure.windows-x64`), it is not necessary to reconfigure back for Linux; you can leave it configured for Windows -- Always run `make clean` when switching build configurations or targets between Linux (`./configure`) and Windows (`./configure.windows-x64`) ## Code Style Guidelines diff --git a/configure.windows-x64 b/configure.windows-x64 index 8b7107f8..104eb83f 100755 --- a/configure.windows-x64 +++ b/configure.windows-x64 @@ -1,3 +1,4 @@ -./configure --host=x86_64-w64-mingw32.static --build=`./config.guess` $@ +DIR=$(dirname "$0") +"$DIR/configure" --host=x86_64-w64-mingw32.static --build=$("$DIR/config.guess") "$@" diff --git a/configure.windows-x86 b/configure.windows-x86 index 913871a4..306f48f7 100755 --- a/configure.windows-x86 +++ b/configure.windows-x86 @@ -1,3 +1,4 @@ -./configure --host=i686-w64-mingw32.static --build=`./config.guess` $@ +DIR=$(dirname "$0") +"$DIR/configure" --host=i686-w64-mingw32.static --build=$("$DIR/config.guess") "$@"