Skip to content

Commit 0372364

Browse files
try build software, sdl for linux32
1 parent 1fe4a3e commit 0372364

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ jobs:
237237
# For example, pypy2 and pypy3
238238
matrix:
239239
python-version: ['python3.7', 'python3.8', 'python3.9', 'python3.10', 'python3.11', 'python3.12', 'python3.13', 'python3.14', 'pypy3.11']
240-
raylib-platform: ['Desktop', 'SDL', 'DRM']
240+
raylib-platform: ['Desktop', 'SDL', 'DRM', 'SDL_SOFT']
241241
steps:
242242
- name: fix node
243243
run: |
@@ -273,7 +273,17 @@ jobs:
273273
cd raylib-c
274274
mkdir build
275275
cd build
276-
cmake -DPLATFORM=${{ matrix.raylib-platform }} -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
276+
PLATFORM = ${{ matrix.raylib-platform }}
277+
if [ ${{ matrix.raylib-platform }} = "DRM" ]; then
278+
OPENGL="ES 2.0"
279+
elif [ ${{ matrix.raylib-platform }} = "SDL_SOFT" ]; then
280+
OPENGL="Software"
281+
PLATFORM = "SDL"
282+
else
283+
OPENGL="3.3"
284+
fi
285+
echo "OPENGL $OPENGL PLATFORM $PLATFORM"
286+
cmake -DPLATFORM="$PLATFORM" -DOPENGL_VERSION="$OPENGL" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
277287
make -j2
278288
make install
279289
- name: Copy extras
@@ -359,6 +369,16 @@ jobs:
359369
tar xvfz cmake-3.31.10-linux-x86_64.tar.gz
360370
cp -r cmake-3.31.10-linux-x86_64/* /usr/
361371
372+
- name: Build SDL
373+
run: |
374+
wget https://github.com/libsdl-org/SDL/releases/download/release-3.2.28/SDL3-3.2.28.tar.gz
375+
tar xvfz SDL3-3.2.28.tar.gz
376+
mkdir build
377+
cd build
378+
cmake ../SDL3-3.2.28 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DSDL_VULKAN=OFF -DSDL_CAMERA=OFF -DSDL_GPU=OFF
379+
cmake --build . --config Release
380+
cmake --install .
381+
362382
- uses: actions/checkout@v2
363383
with:
364384
submodules: recursive

raylib/build.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#
3333
# Environment variables you can set before build
3434
#
35-
# RAYLIB_PLATFORM: Any one of: Desktop, SDL, DRM, PLATFORM_COMMA
35+
# RAYLIB_PLATFORM: Any one of: Desktop, SDL, DRM, PLATFORM_COMMA, SDL_SOFTWARE
3636
# RAYLIB_LINK_ARGS: Arguments to pass to the linker rather than getting them from pkg-config.
3737
# e.g.: -L/usr/local/lib -lraylib
3838
# RAYLIB_INCLUDE_PATH: Directory to find raylib.h rather than getting from pkg-config.
@@ -143,7 +143,7 @@ def build_unix():
143143
raise Exception("ERROR: raylib not found by pkg-config. Please install pkg-config and Raylib"
144144
"or else set RAYLIB_LINK_ARGS env variable.")
145145

146-
if RAYLIB_PLATFORM=="SDL" and os.getenv("RAYLIB_LINK_ARGS") is None and not check_sdl_pkgconfig_installed():
146+
if RAYLIB_PLATFORM.startswith("SDL") and os.getenv("RAYLIB_LINK_ARGS") is None and not check_sdl_pkgconfig_installed():
147147
print("PKG_CONFIG_PATH is set to: "+os.getenv("PKG_CONFIG_PATH"))
148148
raise Exception("ERROR: SDL3 not found by pkg-config. Please install pkg-config and SDL3."
149149
"or else set RAYLIB_LINK_ARGS env variable.")
@@ -235,17 +235,20 @@ def build_unix():
235235
flags = os.getenv("RAYLIB_LINK_ARGS")
236236
if flags is None:
237237
flags = get_lib_flags_from_pkgconfig()
238-
extra_link_args = flags.split() + [ '-lm', '-lpthread', '-lGL',
238+
extra_link_args = flags.split() + [ '-lm', '-lpthread',
239239
'-lrt', '-lm', '-ldl', '-lpthread', '-latomic']
240240
if RAYLIB_PLATFORM=="SDL":
241-
extra_link_args += ['-lX11','-lSDL3']
241+
extra_link_args += ['-lX11','-lGL', '-lSDL3']
242242
elif RAYLIB_PLATFORM=="DRM":
243-
extra_link_args += ['-lEGL', '-lgbm']
243+
extra_link_args += ['-lGL', '-lEGL', '-lgbm']
244244
elif RAYLIB_PLATFORM=="PLATFORM_COMMA":
245-
extra_link_args.remove('-lGL')
246245
extra_link_args += ['-lGLESv2', '-lEGL', '-lwayland-client', '-lwayland-egl']
246+
elif RAYLIB_PLATFORM=="Desktop":
247+
extra_link_args += ['-lX11','-lGL']
248+
elif RAYLIB_PLATFORM=="SDL_SOFT":
249+
extra_link_args += ['-lX11', '-lSDL3']
247250
else:
248-
extra_link_args += ['-lX11']
251+
raise Exception("Unknown or not set RAYLIB_PLATFORM")
249252
extra_compile_args = ["-Wno-incompatible-pointer-types", "-D_CFFI_NO_LIMITED_API"]
250253
libraries = [] # Not sure why but we put them in extra_link_args instead so *shouldnt* be needed here
251254

0 commit comments

Comments
 (0)