@@ -58,10 +58,12 @@ 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
6363 - name : Configure + build (WinXP)
6464 run : |
65+ set -euo pipefail
66+
6567 export PATH="$GITHUB_WORKSPACE/mxe/usr/bin:$PATH"
6668
6769 # MXE prefix for the i686 static target
@@ -71,24 +73,29 @@ jobs:
7173 export CMAKE_PREFIX_PATH="$MXE_PREFIX"
7274 export PKG_CONFIG_PATH="$MXE_PREFIX/lib/pkgconfig"
7375
74- # IMPORTANT (Option 1):
75- # Use MXE's jsoncpp headers (v1.9.1) instead of repo headers (v1.9.7),
76- # to match the jsoncpp library we link against.
77- export CPPFLAGS="-I$MXE_PREFIX/include/jsoncpp -I$MXE_PREFIX/include -I$MXE_PREFIX/include/SDL -I$GITHUB_WORKSPACE/deps/include/SDL_net -I$GITHUB_WORKSPACE/deps/include"
78- export CFLAGS="$CPPFLAGS"
79- export CXXFLAGS="$CPPFLAGS"
80-
81- echo "=== DEBUG: jsoncpp version headers present ==="
82- ls -la "$MXE_PREFIX/include/jsoncpp/json/version.h" || true
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
8380 ls -la "$GITHUB_WORKSPACE/deps/include/json/version.h" || true
8481
8582 echo "=== DEBUG: key libs present in MXE_PREFIX/lib ==="
8683 ls -la "$MXE_PREFIX/lib" | grep -Ei "json|sdl|jpeg|png|webp|smpeg|modplug|vorbis|ogg|ws2|iphlp|winmm|dxguid" || true
8784
85+ # IMPORTANT:
86+ # Do NOT use -I$MXE_PREFIX/include/jsoncpp because it doesn't exist in your MXE layout.
87+ # Put MXE include FIRST so <json/json.h> resolves to MXE headers (matching libjsoncpp.a),
88+ # and keep deps/include later (for other headers).
89+ export CPPFLAGS="-I$MXE_PREFIX/include -I$MXE_PREFIX/include/SDL -I$GITHUB_WORKSPACE/deps/include/SDL_net -I$GITHUB_WORKSPACE/deps/include"
90+ export CFLAGS="$CPPFLAGS"
91+ export CXXFLAGS="$CPPFLAGS"
92+
8893 # NOTE (Option A):
8994 # Do NOT force -l... libs via LDFLAGS here.
9095 # The corrected src/CMakeLists.txt links required libs with correct ordering.
96+ unset LDFLAGS || true
9197
98+ rm -rf build
9299 mkdir -p build
93100 cd build
94101
0 commit comments