mirror of https://github.com/ppy/SDL3-CS.git
commit
07db29ef06
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
pushd "$(dirname "$0")" >/dev/null
|
||||
set -e
|
||||
|
||||
pushd "$(dirname "$0")"
|
||||
|
||||
# Check if environment variables are defined
|
||||
if [[ -z $NAME || -z $RUNNER_OS || -z $FLAGS ]]; then
|
||||
|
|
@ -8,7 +10,7 @@ if [[ -z $NAME || -z $RUNNER_OS || -z $FLAGS ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
SUDO=$(which sudo)
|
||||
SUDO=$(which sudo || exit 0)
|
||||
|
||||
if [[ $RUNNER_OS == 'Linux' ]]; then
|
||||
# Setup Linux dependencies
|
||||
|
|
@ -86,12 +88,18 @@ if [[ $RUNNER_OS == 'Linux' ]]; then
|
|||
fi
|
||||
|
||||
# Build SDL
|
||||
pushd SDL >/dev/null
|
||||
git reset --hard HEAD
|
||||
pushd SDL
|
||||
git reset --hard HEAD || echo "Failed to clean up the repository"
|
||||
|
||||
if [[ $RUNNER_OS == 'Windows' ]]; then
|
||||
echo "Patching SDL to not include gameinput.h"
|
||||
sed -i 's/#include <gameinput.h>/#_include <gameinput.h>/g' CMakeLists.txt
|
||||
fi
|
||||
|
||||
cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON
|
||||
cmake --build build/ --config Release
|
||||
$SUDO cmake --install build/ --prefix install_output --config Release
|
||||
popd >/dev/null
|
||||
popd
|
||||
|
||||
# Move build lib into correct folders
|
||||
if [[ $RUNNER_OS == 'Windows' ]]; then
|
||||
|
|
@ -102,4 +110,4 @@ elif [[ $RUNNER_OS == 'macOS' ]]; then
|
|||
cp SDL/install_output/lib/libSDL3.dylib ../native/$NAME/libSDL3.dylib
|
||||
fi
|
||||
|
||||
popd >/dev/null
|
||||
popd
|
||||
|
|
|
|||
Loading…
Reference in New Issue