Skip to content

Commit a85a704

Browse files
committed
Update workflows, fix linux i686
1 parent e8198e5 commit a85a704

2 files changed

Lines changed: 43 additions & 13 deletions

File tree

.github/workflows/build.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
include:
16-
- { name: "Windows x86_64", os: windows-latest, msys2_sys: MINGW64, msys2_env: mingw-w64-x86_64 }
17-
- { name: "Windows i686", os: windows-latest, msys2_sys: MINGW32, msys2_env: mingw-w64-i686 }
18-
- { name: "Linux x86_64", os: ubuntu-latest, linux_arch: x86_64 }
19-
- { name: "Linux i686", os: ubuntu-latest, linux_arch: i686 }
20-
- { name: "macOS ARM64", os: macos-latest }
21-
- { name: "macOS x86_64", os: macos-latest, macos_arch: x86_64 }
16+
- { name: "Windows-x86_64", os: windows-latest, msys2_sys: MINGW64, msys2_env: mingw-w64-x86_64 }
17+
- { name: "Windows-i686", os: windows-latest, msys2_sys: MINGW32, msys2_env: mingw-w64-i686 }
18+
- { name: "Linux-x86_64", os: ubuntu-latest, linux_arch: x86_64 }
19+
- { name: "Linux-i686", os: ubuntu-latest, linux_arch: i686 }
20+
- { name: "macOS-ARM64", os: macos-latest }
21+
- { name: "macOS-x86_64", os: macos-latest, macos_arch: x86_64 }
2222

2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v6
2525

2626
# ── Windows ──────────────────────────────────────────────────────
2727
- uses: msys2/setup-msys2@v2
@@ -55,8 +55,11 @@ jobs:
5555
run: |
5656
sudo dpkg --add-architecture i386
5757
sudo apt-get update
58-
sudo apt-get install -y gcc-i686-linux-gnu g++-i686-linux-gnu cmake \
59-
libsdl2-dev:i386 libgl-dev:i386
58+
sudo apt-get install -y gcc-multilib g++-multilib cmake
59+
# Install 32-bit libraries without dev packages to avoid glib conflicts
60+
sudo apt-get install -y libsdl2-2.0-0:i386 libgl1:i386 libglx0:i386 libopengl0:i386
61+
# Install x86_64 dev packages (headers are arch-independent)
62+
sudo apt-get install -y libsdl2-dev libgl-dev
6063
6164
- name: Build (Linux x86_64)
6265
if: runner.os == 'Linux' && matrix.linux_arch == 'x86_64'
@@ -109,13 +112,13 @@ jobs:
109112
arch -x86_64 make -j$(sysctl -n hw.ncpu)
110113
111114
# ── Artifacts ─────────────────────────────────────────────────────
112-
- uses: actions/upload-artifact@v4
115+
- uses: actions/upload-artifact@v7
113116
if: runner.os == 'Windows' || (runner.os == 'Linux' && matrix.linux_arch == 'x86_64') || runner.os == 'macOS'
114117
with:
115118
name: AnimalCrossing-${{ matrix.name }}
116119
path: pc/build/bin/
117120

118-
- uses: actions/upload-artifact@v4
121+
- uses: actions/upload-artifact@v7
119122
if: runner.os == 'Linux' && matrix.linux_arch == 'i686'
120123
with:
121124
name: AnimalCrossing-${{ matrix.name }}

pc/cmake/Toolchain-linux32.cmake

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
11
# CMake toolchain file for Linux i686 (32-bit) cross-compilation
22
set(CMAKE_SYSTEM_NAME Linux)
33
set(CMAKE_SYSTEM_PROCESSOR i686)
4-
set(CMAKE_C_COMPILER i686-linux-gnu-gcc)
5-
set(CMAKE_CXX_COMPILER i686-linux-gnu-g++)
4+
5+
# Use multilib gcc/g++ instead of cross-compiler
6+
set(CMAKE_C_COMPILER gcc)
7+
set(CMAKE_CXX_COMPILER g++)
8+
9+
# Force 32-bit compilation
610
set(CMAKE_C_FLAGS "-m32" CACHE STRING "")
711
set(CMAKE_CXX_FLAGS "-m32" CACHE STRING "")
12+
set(CMAKE_EXE_LINKER_FLAGS "-m32" CACHE STRING "")
13+
set(CMAKE_SHARED_LINKER_FLAGS "-m32" CACHE STRING "")
14+
15+
# Tell CMake to look for 32-bit libraries
16+
set(CMAKE_LIBRARY_ARCHITECTURE i386-linux-gnu)
17+
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
18+
19+
# Help CMake find 32-bit libraries
20+
set(CMAKE_LIBRARY_PATH /usr/lib/i386-linux-gnu)
21+
set(CMAKE_FIND_ROOT_PATH /usr/lib/i386-linux-gnu)
22+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
23+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
24+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
25+
26+
# Explicitly set OpenGL library paths for 32-bit linking
27+
# Use runtime libraries (.so.0) since dev packages cause dependency conflicts
28+
set(OPENGL_opengl_LIBRARY /usr/lib/i386-linux-gnu/libOpenGL.so.0 CACHE FILEPATH "")
29+
set(OPENGL_glx_LIBRARY /usr/lib/i386-linux-gnu/libGLX.so.0 CACHE FILEPATH "")
30+
31+
# Workaround: SDL2's multiarch wrapper includes <SDL2/_real_SDL_config.h> which
32+
# lives in /usr/include/<arch>/SDL2/. Since we can't install libsdl2-dev:i386
33+
# (causes glib conflicts), we use the x86_64 headers which are arch-independent.
34+
include_directories(BEFORE SYSTEM /usr/include/x86_64-linux-gnu)

0 commit comments

Comments
 (0)