Skip to content

Commit 3e52a7d

Browse files
committed
Fix build-mxe.yml
1 parent 890688c commit 3e52a7d

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/build-winxp.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,25 @@ jobs:
7171
export CMAKE_PREFIX_PATH="$MXE_PREFIX"
7272
export PKG_CONFIG_PATH="$MXE_PREFIX/lib/pkgconfig"
7373
74-
# IMPORTANT: make #include <SDL_net.h> work by adding your vendored header dir,
75-
# and also add MXE's SDL include dir for safety.
76-
export CPPFLAGS="-I$MXE_PREFIX/include -I$MXE_PREFIX/include/SDL -I$GITHUB_WORKSPACE/deps/include/SDL_net"
74+
# Make your vendored headers work (#include <SDL_net.h>, json headers etc.)
75+
export CPPFLAGS="-I$MXE_PREFIX/include -I$MXE_PREFIX/include/SDL -I$GITHUB_WORKSPACE/deps/include/SDL_net -I$GITHUB_WORKSPACE/deps/include"
7776
export CFLAGS="$CPPFLAGS"
7877
export CXXFLAGS="$CPPFLAGS"
7978
80-
echo "=== DEBUG: SDL_net header locations ==="
81-
ls -la "$GITHUB_WORKSPACE/deps/include/SDL_net/SDL_net.h" || true
82-
ls -la "$MXE_PREFIX/include/SDL/SDL_net.h" || true
79+
echo "=== DEBUG: key libs present in MXE_PREFIX/lib ==="
80+
ls -la "$MXE_PREFIX/lib" | grep -Ei "json|sdl|jpeg|png|webp|smpeg|modplug|ws2|iphlp|winmm|dxguid" || true
81+
82+
# Force link libs without touching CMakeLists.txt
83+
# - jsoncpp: fixes Json::Value / Json::CharReader undefined references
84+
# - ws2_32/iphlpapi: fixes SDL_net winsock + GetAdaptersInfo
85+
# - winmm: fixes midiOut* symbols from SDL_mixer
86+
# - dxguid: fixes DirectDraw IID_* symbols from SDL
87+
# - jpeg/png/webp/smpeg/modplug: fixes SDL_image/SDL_mixer optional codec symbols when linked statically
88+
export LDFLAGS="-L$MXE_PREFIX/lib \
89+
-ljsoncpp \
90+
-lws2_32 -liphlpapi -lwinmm -ldxguid \
91+
-ljpeg -lpng -lwebp \
92+
-lsmpeg -lmodplug"
8393
8494
mkdir -p build
8595
cd build
@@ -91,7 +101,7 @@ jobs:
91101
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
92102
"$GITHUB_WORKSPACE"
93103
94-
make -j"$(nproc)"
104+
make -j"$(nproc)" VERBOSE=1
95105
96106
- name: Package zip
97107
run: |

0 commit comments

Comments
 (0)