@@ -58,82 +58,90 @@ jobs:
5858 uses : actions/cache@v4
5959 with :
6060 path : mxe
61- key : ${{ runner.os }}-mxe-v7e39b555dee5e906b24a44940055dc28d4056d23-gcc11-jsoncpp-sdl_net-v6
61+ key : ${{ runner.os }}-mxe-v7e39b555dee5e906b24a44940055dc28d4056d23-gcc11-jsoncpp-sdl_net-v7
6262
63- - name : Configure + build (WinXP)
63+ - name : Configure (WinXP)
6464 run : |
65- set -euxo pipefail
66-
6765 export PATH="$GITHUB_WORKSPACE/mxe/usr/bin:$PATH"
6866 export MXE_PREFIX="$GITHUB_WORKSPACE/mxe/usr/i686-w64-mingw32.static"
6967
7068 # Make sure CMake/pkg-config find MXE (not host)
7169 export CMAKE_PREFIX_PATH="$MXE_PREFIX"
7270 export PKG_CONFIG_PATH="$MXE_PREFIX/lib/pkgconfig"
7371
74- echo "=== DEBUG: jsoncpp headers we will use (MXE) ==="
75- ls -la "$MXE_PREFIX/include/json/version.h " || true
72+ echo "=== DEBUG: json headers location check ==="
73+ ls -la "$MXE_PREFIX/include/json" || true
7674 ls -la "$MXE_PREFIX/include/json/json.h" || true
75+ ls -la "$GITHUB_WORKSPACE/deps/include/json/json.h" || true
7776
78- echo "=== DEBUG: SDL_net header in MXE ==="
79- ls -la "$MXE_PREFIX/include/SDL/SDL_net.h" || true
80-
81- echo "=== DEBUG: key libs in MXE ==="
77+ echo "=== DEBUG: key libs present in MXE_PREFIX/lib ==="
8278 ls -la "$MXE_PREFIX/lib" | grep -Ei "json|sdl|jpeg|png|webp|smpeg|modplug|vorbis|ogg|ws2|iphlp|winmm|dxguid" || true
8379
80+ rm -rf build
8481 mkdir -p build
8582 cd build
8683
87- # IMPORTANT:
88- # - Put MXE include dirs FIRST so we don't accidentally use deps/include jsoncpp headers.
89- # - Add SDL include dir so <SDL_net.h> works (header is in include/SDL/SDL_net.h).
90- #
91- # Linker:
92- # - Use --start-group/--end-group to avoid static link order issues (vorbisfile/vorbis/ogg, SDL_net/ws2_32, etc.)
9384 i686-w64-mingw32.static-cmake \
9485 -DCMAKE_BUILD_TYPE=Release \
9586 -DDEV_BUILD=OFF \
9687 -DBUILD_PACKAGE=OFF \
9788 -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
98- -DCMAKE_CXX_FLAGS="-I$MXE_PREFIX/include -I$MXE_PREFIX/include/SDL" \
99- -DCMAKE_EXE_LINKER_FLAGS="-Wl,--start-group -Wl,--end-group" \
10089 "$GITHUB_WORKSPACE"
10190
91+ - name : Patch link order (start-group/end-group) for static link
92+ run : |
93+ RSP="build/src/CMakeFiles/openxcom.dir/linklibs.rsp"
94+ if [ -f "$RSP" ]; then
95+ echo "=== BEFORE patch: $RSP ==="
96+ cat "$RSP" || true
97+
98+ # Flatten to one line and wrap with start/end-group to fix static link ordering
99+ ONE_LINE="$(tr '\n' ' ' < "$RSP")"
100+ echo " -Wl,--start-group $ONE_LINE -Wl,--end-group " > "$RSP"
101+
102+ echo "=== AFTER patch: $RSP ==="
103+ cat "$RSP" || true
104+ else
105+ echo "WARN: linklibs.rsp not found yet at $RSP (CMake layout changed?)"
106+ find build -maxdepth 5 -name "linklibs.rsp" -print || true
107+ fi
108+
109+ - name : Build (WinXP)
110+ run : |
111+ export PATH="$GITHUB_WORKSPACE/mxe/usr/bin:$PATH"
112+ cd build
102113 make -j"$(nproc)" VERBOSE=1
103114
104- # Collect link files even if the build fails
105- - name : Collect link files
115+ - name : Collect link files (always)
106116 if : always()
107117 run : |
108- set -euxo pipefail
109- mkdir -p artifacts-link
118+ mkdir -p artifacts/link
119+ echo "=== FIND link.txt / linklibs.rsp ==="
120+ find build -name "link.txt" -o -name "linklibs.rsp" -print || true
110121
111- # Try common locations
112- if [ -f "build/src/CMakeFiles/openxcom.dir/link.txt" ]; then
113- cp -v "build/src/CMakeFiles/openxcom.dir/link.txt" artifacts-link/link.txt
114- fi
115- if [ -f "build/src/CMakeFiles/openxcom.dir/linklibs.rsp" ]; then
116- cp -v "build/src/CMakeFiles/openxcom.dir/linklibs.rsp" artifacts-link/linklibs.rsp
117- fi
122+ # Copy if present
123+ cp -v build/src/CMakeFiles/openxcom.dir/link.txt artifacts/link/ 2>/dev/null || true
124+ cp -v build/src/CMakeFiles/openxcom.dir/linklibs.rsp artifacts/link/ 2>/dev/null || true
125+
126+ echo "=== artifacts/link contents ==="
127+ ls -la artifacts/link || true
128+
129+ echo "=== link.txt (if exists) ==="
130+ sed -n '1,200p' artifacts/link/link.txt 2>/dev/null || true
118131
119- # Also dump to job log for quick viewing
120- echo "=== link.txt ==="
121- (cat artifacts-link/link.txt || true)
122- echo "=== linklibs.rsp ==="
123- (cat artifacts-link/linklibs.rsp || true)
132+ echo "=== linklibs.rsp (if exists) ==="
133+ sed -n '1,200p' artifacts/link/linklibs.rsp 2>/dev/null || true
124134
125- - name : Upload link debug artifacts
135+ - name : Upload link logs artifact (always)
126136 if : always()
127137 uses : actions/upload-artifact@v4
128138 with :
129- name : link-debug -${{ env.SAFE_REF }}
130- path : artifacts-link/
139+ name : link-logs -${{ env.SAFE_REF }}
140+ path : artifacts/link
131141
132142 - name : Package zip
133- # Only package if build succeeded and bin exists
134143 if : success()
135144 run : |
136- set -euxo pipefail
137145 cd build/bin
138146 rm -f libopenxcom.dll.a || true
139147 zip -r "../../openxcom-winxp-${{ env.SAFE_REF }}.zip" .
0 commit comments