2021-12-07 02:00:01 -07:00
|
|
|
name: Build (Sony Playstation Portable)
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-12-04 10:06:06 -07:00
|
|
|
concurrency:
|
2022-12-04 10:50:06 -07:00
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
2022-12-04 10:06:06 -07:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-12-07 02:00:01 -07:00
|
|
|
jobs:
|
|
|
|
psp:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: pspdev/pspdev:latest
|
|
|
|
steps:
|
2024-01-25 18:33:20 -07:00
|
|
|
- uses: actions/checkout@v4
|
2021-12-07 02:00:01 -07:00
|
|
|
- name: Setup dependencies
|
|
|
|
run: |
|
2023-01-23 12:18:48 -07:00
|
|
|
apk update
|
2022-06-16 08:38:58 -06:00
|
|
|
apk add cmake gmp mpc1 mpfr4 make pkgconf
|
2024-03-29 12:04:16 -06:00
|
|
|
- name: Pollute PSP SDK with "bad" SDL headers
|
|
|
|
run: |
|
|
|
|
# Create "bad" SDL headers in the PSP SDK.
|
|
|
|
# SDL sources should not use these.
|
|
|
|
infixes=". psp psp/sdk"
|
|
|
|
for infix in $infixes; do
|
|
|
|
directory="$PSPDEV/$infix/include/SDL3"
|
|
|
|
echo "Creating directory $directory"
|
|
|
|
mkdir -p "$directory"
|
|
|
|
for include in include/SDL3/*.h; do
|
|
|
|
dest="$PSPDEV/$infix/include/SDL3/$(basename "$include")"
|
|
|
|
echo "Creating $dest"
|
|
|
|
echo '#error "System SDL headers must not be used by build system"' >"$dest"
|
|
|
|
done
|
|
|
|
done
|
2023-01-28 22:12:40 -07:00
|
|
|
- name: Configure (CMake)
|
2022-06-03 11:24:20 -06:00
|
|
|
run: |
|
|
|
|
cmake -S . -B build \
|
2023-01-23 21:30:24 -07:00
|
|
|
-Wdeprecated -Wdev -Werror \
|
2022-06-03 11:24:20 -06:00
|
|
|
-DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
|
2022-10-10 20:04:15 -06:00
|
|
|
-DSDL_WERROR=ON \
|
2022-06-03 11:24:20 -06:00
|
|
|
-DSDL_TESTS=ON \
|
2022-05-08 10:08:41 -06:00
|
|
|
-DSDL_INSTALL_TESTS=ON \
|
2022-06-03 11:24:20 -06:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=prefix
|
2023-01-28 22:12:40 -07:00
|
|
|
- name: Build (CMake)
|
2022-11-30 15:38:25 -07:00
|
|
|
run: cmake --build build --config Release --verbose
|
2023-01-28 22:12:40 -07:00
|
|
|
- name: Install (CMake)
|
2022-06-03 11:24:20 -06:00
|
|
|
run: |
|
2022-11-21 22:36:19 -07:00
|
|
|
echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
|
2022-06-03 11:24:20 -06:00
|
|
|
cmake --install build --config Release
|
|
|
|
( cd prefix; find ) | LC_ALL=C sort -u
|
2023-01-28 22:12:40 -07:00
|
|
|
- name: Package (CPack)
|
|
|
|
run: |
|
|
|
|
cmake --build build/ --config Release --target package
|
2022-06-03 11:24:20 -06:00
|
|
|
- name: Verify CMake configuration files
|
|
|
|
run: |
|
|
|
|
cmake -S cmake/test -B cmake_config_build \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
|
2022-11-21 22:36:19 -07:00
|
|
|
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \
|
2022-06-03 11:24:20 -06:00
|
|
|
-DTEST_SHARED=FALSE \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
cmake --build cmake_config_build --verbose
|
2022-11-21 22:36:19 -07:00
|
|
|
- name: Verify sdl3.pc
|
2022-06-16 08:38:58 -06:00
|
|
|
run: |
|
|
|
|
export CC=psp-gcc
|
2023-01-15 09:39:07 -07:00
|
|
|
export LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
|
2022-11-21 22:36:19 -07:00
|
|
|
export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
|
2022-06-16 08:38:58 -06:00
|
|
|
cmake/test/test_pkgconfig.sh
|
2024-01-25 18:33:20 -07:00
|
|
|
- uses: actions/upload-artifact@v4
|
2023-01-28 22:12:40 -07:00
|
|
|
with:
|
|
|
|
if-no-files-found: error
|
|
|
|
name: SDL-psp
|
|
|
|
path: build/dist/SDL3*
|