@@ -60,36 +60,32 @@ jobs:
6060 path : mxe
6161 key : ${{ runner.os }}-mxe-v7e39b555dee5e906b24a44940055dc28d4056d23-gcc11-jsoncpp-sdl_net-v7
6262
63- - name : Configure + build (WinXP)
63+ - name : Prepare env
6464 run : |
6565 set -euo pipefail
66-
6766 export PATH="$GITHUB_WORKSPACE/mxe/usr/bin:$PATH"
68-
69- # MXE prefix for the i686 static target
7067 export MXE_PREFIX="$GITHUB_WORKSPACE/mxe/usr/i686-w64-mingw32.static"
71-
72- # Make sure CMake/pkg-config find MXE (not host) headers/libs
7368 export CMAKE_PREFIX_PATH="$MXE_PREFIX"
7469 export PKG_CONFIG_PATH="$MXE_PREFIX/lib/pkgconfig"
7570
76- echo "=== DEBUG: where is jsoncpp header in MXE? ==="
77- ls -la "$MXE_PREFIX/include/json/json.h" || true
78- ls -la "$MXE_PREFIX/include/jsoncpp/json/json.h" || true
79- ls -la "$MXE_PREFIX/include/json/version.h" || true
80- ls -la "$GITHUB_WORKSPACE/deps/include/json/version.h" || true
81-
82- echo "=== DEBUG: key libs present in MXE_PREFIX/lib ==="
83- ls -la "$MXE_PREFIX/lib" | grep -Ei "json|sdl|jpeg|png|webp|smpeg|modplug|vorbis|ogg|ws2|iphlp|winmm|dxguid" || true
84-
85- # Put MXE include FIRST so <json/json.h> resolves to MXE headers (matching libjsoncpp.a)
71+ # Prefer MXE headers first
8672 export CPPFLAGS="-I$MXE_PREFIX/include -I$MXE_PREFIX/include/SDL -I$GITHUB_WORKSPACE/deps/include/SDL_net -I$GITHUB_WORKSPACE/deps/include"
8773 export CFLAGS="$CPPFLAGS"
8874 export CXXFLAGS="$CPPFLAGS"
8975
90- # Option A: do not force -l... via LDFLAGS (CMakeLists handles link order)
9176 unset LDFLAGS || true
9277
78+ echo "PATH=$PATH" >> $GITHUB_ENV
79+ echo "MXE_PREFIX=$MXE_PREFIX" >> $GITHUB_ENV
80+ echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
81+ echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
82+ echo "CPPFLAGS=$CPPFLAGS" >> $GITHUB_ENV
83+ echo "CFLAGS=$CFLAGS" >> $GITHUB_ENV
84+ echo "CXXFLAGS=$CXXFLAGS" >> $GITHUB_ENV
85+
86+ - name : Configure (WinXP)
87+ run : |
88+ set -euo pipefail
9389 rm -rf build
9490 mkdir -p build
9591 cd build
@@ -101,24 +97,45 @@ jobs:
10197 -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
10298 "$GITHUB_WORKSPACE"
10399
100+ echo "=== DEBUG: link.txt location candidates ==="
101+ ls -la src/CMakeFiles/openxcom.dir/link.txt || true
102+ ls -la CMakeFiles/openxcom.dir/link.txt || true
103+
104+ - name : Upload link.txt (after configure)
105+ if : always()
106+ uses : actions/upload-artifact@v4
107+ with :
108+ name : linktxt-config-${{ env.SAFE_REF }}
109+ path : |
110+ build/src/CMakeFiles/openxcom.dir/link.txt
111+ build/CMakeFiles/openxcom.dir/link.txt
112+ if-no-files-found : warn
113+
114+ - name : Build (WinXP)
115+ run : |
116+ set -euo pipefail
117+ cd build
104118 make -j"$(nproc)" VERBOSE=1
105119
106- - name : Upload link.txt
120+ - name : Upload link.txt (after build)
121+ if : always()
107122 uses : actions/upload-artifact@v4
108123 with :
109- name : linktxt-${{ env.SAFE_REF }}
124+ name : linktxt-build- ${{ env.SAFE_REF }}
110125 path : |
111126 build/src/CMakeFiles/openxcom.dir/link.txt
112127 build/CMakeFiles/openxcom.dir/link.txt
113128 if-no-files-found : warn
114129
115130 - name : Package zip
131+ if : success()
116132 run : |
117133 cd build/bin
118134 rm -f libopenxcom.dll.a || true
119135 zip -r "../../openxcom-winxp-${{ env.SAFE_REF }}.zip" .
120136
121137 - name : Upload artifact
138+ if : success()
122139 uses : actions/upload-artifact@v4
123140 with :
124141 name : openxcom-winxp-${{ env.SAFE_REF }}
0 commit comments