SDL3 built as a static library as part of build process
All checks were successful
Build and Deploy / build-linux (push) Successful in 1m12s
Build and Deploy / build-windows (CLANG64) (push) Successful in 14m52s
Build and Deploy / package-dist (push) Has been skipped
Build and Deploy / deploy-itch (push) Has been skipped
Build and Deploy / deploy-gitea (push) Has been skipped
All checks were successful
Build and Deploy / build-linux (push) Successful in 1m12s
Build and Deploy / build-windows (CLANG64) (push) Successful in 14m52s
Build and Deploy / package-dist (push) Has been skipped
Build and Deploy / deploy-itch (push) Has been skipped
Build and Deploy / deploy-gitea (push) Has been skipped
This commit is contained in:
49
.github/workflows/build.yml
vendored
49
.github/workflows/build.yml
vendored
@@ -18,35 +18,8 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Cache SDL3 (Linux)
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
sdl3
|
||||
sdl3-build
|
||||
key: sdl3-linux-${{ hashFiles('sdl3/CMakeLists.txt') }}
|
||||
|
||||
- name: Build SDL3 (Linux)
|
||||
run: |
|
||||
if [ ! -d "sdl3/.git" ]; then
|
||||
echo "Cloning SDL3 repository..."
|
||||
git clone --depth 1 --branch main https://github.com/libsdl-org/SDL.git sdl3
|
||||
else
|
||||
echo "SDL3 source is already present (possibly from cache)."
|
||||
fi
|
||||
mkdir -p sdl3-build
|
||||
cd sdl3-build
|
||||
cmake ../sdl3 -GNinja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${PWD}/installed_sdl3" \
|
||||
-DSDL_SHARED=ON \
|
||||
-DSDL_STATIC=OFF
|
||||
ninja
|
||||
ninja install
|
||||
|
||||
- name: Build Prosperon (Linux)
|
||||
run: |
|
||||
export PKG_CONFIG_PATH="${PWD}/sdl3-build/installed_sdl3/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true
|
||||
meson compile -C build
|
||||
|
||||
@@ -55,6 +28,7 @@ jobs:
|
||||
TRACY_NO_INVARIANT_CHECK: 1
|
||||
run: |
|
||||
meson test --print-errorlogs -C build
|
||||
strip build/prosperon
|
||||
|
||||
- name: Upload Test Log (Linux)
|
||||
if: ${{ always() }}
|
||||
@@ -63,19 +37,12 @@ jobs:
|
||||
name: testlog-linux
|
||||
path: build/meson-logs/testlog.txt
|
||||
|
||||
- name: Create artifact folder (Linux)
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
mkdir _pack
|
||||
cp build/prosperon _pack/
|
||||
cp sdl3-build/installed_sdl3/lib/libSDL3.so _pack/
|
||||
|
||||
- name: Upload Artifact (Linux)
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: prosperon-artifacts-linux
|
||||
path: _pack
|
||||
path: build/prosperon
|
||||
|
||||
build-windows:
|
||||
runs-on: win-native
|
||||
@@ -101,7 +68,6 @@ jobs:
|
||||
pacboy: |
|
||||
meson
|
||||
cmake
|
||||
sdl3
|
||||
toolchain
|
||||
|
||||
- name: Build Prosperon
|
||||
@@ -117,6 +83,7 @@ jobs:
|
||||
TRACY_NO_INVARIANT_CHECK: 1
|
||||
run: |
|
||||
meson test --print-errorlogs -C build
|
||||
strip build/prosperon.exe
|
||||
|
||||
- name: Upload Test Log
|
||||
if: ${{ always() }}
|
||||
@@ -125,20 +92,12 @@ jobs:
|
||||
name: testlog-windows
|
||||
path: build/meson-logs/testlog.txt
|
||||
|
||||
- name: Create package folder
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir _pack
|
||||
cp build/prosperon.exe _pack/
|
||||
pacboy sdl3 | grep "SDL3.dll$" | awk '{print $2}' | xargs -I {} cp {} _pack/
|
||||
|
||||
- name: Upload Artifact (Windows)
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: prosperon-artifacts-windows
|
||||
path: _pack
|
||||
path: build/prosperon.exe
|
||||
|
||||
package-dist:
|
||||
needs: [build-linux, build-windows]
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
Thank you for using Prosperon!
|
||||
|
||||
Provided are prosperon builds for all available platforms, including SDL3 for each respective one. SDL3 must be present in the same folder as prosperon to run!
|
||||
Provided are prosperon builds for all available platforms. Simply run prosperon for your platform in a game folder to play!
|
||||
|
||||
To get started, take a dive into the provided example games in the examples folder. Just copy the prosperon executable for your platform, along with its SDL3 library, into any provided example folder, then run it!
|
||||
|
||||
NOTE: For MacOS, SDL3 must first be installed with homebrew. After installing homebrew, run `brew install sdl3`. This will be fixed in a future release!
|
||||
To get started, take a dive into the provided example games in the examples folder. Just copy the prosperon executable for your platform, into any provided example folder, then run it!
|
||||
|
||||
You can take a look through the docs folder for the prosperon manual to learn all about it. The manual is available on the web at [docs.prosperon.dev](https://docs.prosperon.dev).
|
||||
|
||||
27
meson.build
27
meson.build
@@ -1,6 +1,6 @@
|
||||
project('prosperon', ['c', 'cpp'], default_options : [ 'cpp_std=c++11'])
|
||||
|
||||
libtype = get_option('default_library')
|
||||
libtype = get_option('default_library')
|
||||
|
||||
link = []
|
||||
src = []
|
||||
@@ -44,8 +44,16 @@ if host_machine.system() == 'darwin'
|
||||
endforeach
|
||||
endif
|
||||
|
||||
cmake = import('cmake')
|
||||
|
||||
sdl3_cmake_options = [
|
||||
'-DSDL_STATIC=ON',
|
||||
'-DSDL_SHARED=OFF',
|
||||
'-DSDL_TEST=OFF',
|
||||
'-DCMAKE_BUILD_TYPE=Release',
|
||||
]
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
deps += dependency('sdl3', required:true)
|
||||
|
||||
if host_machine.system() == 'darwin'
|
||||
deps += dependency('appleframeworks', modules: 'accelerate')
|
||||
@@ -56,22 +64,29 @@ endif
|
||||
if host_machine.system() == 'linux'
|
||||
deps += cc.find_library('asound', required:true)
|
||||
deps += [dependency('x11'), dependency('xi'), dependency('xcursor'), dependency('egl'), dependency('gl')]
|
||||
# link += '-fuse-ld=mold' # use mold, which is very fast, for debug builds
|
||||
endif
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
deps += cc.find_library('d3d11')
|
||||
# these are for tracy
|
||||
deps += cc.find_library('ws2_32', required:true)
|
||||
deps += cc.find_library('dbghelp')
|
||||
#end
|
||||
link += '-static' # Required to pack in mingw dlls on cross compilation
|
||||
deps += cc.find_library('winmm')
|
||||
deps += cc.find_library('setupapi')
|
||||
deps += cc.find_library('imm32')
|
||||
deps += cc.find_library('version')
|
||||
deps += cc.find_library('cfgmgr32')
|
||||
sdl3_cmake_options += '-DHAVE_ISINF=1' # TODO: A hack to get this to compile on MSYS2; otherwise it doesn't link correctly
|
||||
link += '-static'
|
||||
endif
|
||||
|
||||
if host_machine.system() == 'emscripten'
|
||||
link += '-sUSE_WEBGPU'
|
||||
endif
|
||||
|
||||
sdl3_proj = cmake.subproject('sdl3', cmake_options: sdl3_cmake_options)
|
||||
|
||||
deps += sdl3_proj.dependency('SDL3-static')
|
||||
|
||||
tracy_opts = ['fibers=true', 'on_demand=true']
|
||||
quickjs_opts = []
|
||||
|
||||
|
||||
4
subprojects/sdl3.wrap
Normal file
4
subprojects/sdl3.wrap
Normal file
@@ -0,0 +1,4 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/libsdl-org/SDL.git
|
||||
revision = release-3.2.4
|
||||
depth = 1
|
||||
Reference in New Issue
Block a user