Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into SDL3-MorphOS
Browse files Browse the repository at this point in the history
  • Loading branch information
BeWorld2018 committed Jan 15, 2024
2 parents 278c30f + 99f6bcf commit fbe1cca
Show file tree
Hide file tree
Showing 1,239 changed files with 76,958 additions and 24,609 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Build (Android)

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
android:
name: ${{ matrix.platform.name }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
platform:
- { name: Android.mk }
- { name: CMake, cmake: 1, android_abi: "arm64-v8a", android_platform: 23, arch: "aarch64", artifact: "SDL-android-arm64", apk-artifact: "SDL-android-apks-arm64" }

steps:
- uses: actions/checkout@v3
- uses: nttld/setup-ndk@v1
id: setup_ndk
with:
local-cache: true
ndk-version: r21e
- name: Build (Android.mk)
if: ${{ matrix.platform.name == 'Android.mk' }}
run: |
./build-scripts/androidbuildlibs.sh
- uses: actions/setup-java@v3
if: ${{ matrix.platform.name == 'CMake' }}
with:
distribution: 'temurin'
java-version: '11'
- name: Setup (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
sudo apt-get update
sudo apt-get install ninja-build pkg-config
- name: Configure (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake -S . -B build \
-Wdeprecated -Wdev -Werror \
-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DSDL_CLANG_TIDY=ON \
-DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
-DANDROID_ABI=${{ matrix.platform.android_abi }} \
-DSDL_SHARED=ON \
-DSDL_STATIC=ON \
-DSDL_STATIC_PIC=ON \
-DSDL_VENDOR_INFO="Github Workflow" \
-DCMAKE_INSTALL_PREFIX=prefix \
-DCMAKE_BUILD_TYPE=Release \
-GNinja
- name: Build (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake --build build --config Release --parallel --verbose
- name: Build test apk's (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake --build build --config Release --parallel --verbose --target testaudiocapture-apk testcontroller-apk testmultiaudio-apk testsprite-apk
- name: Install (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake --install build --config Release
echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
( cd prefix; find ) | LC_ALL=C sort -u
- name: Package (CPack)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
-DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
-DANDROID_ABI=${{ matrix.platform.android_abi }} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }}
cmake --build cmake_config_build --verbose
- name: Verify sdl3.pc
if: ${{ matrix.platform.name == 'CMake' }}
run: |
export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}"
export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh
- uses: actions/upload-artifact@v3
if: ${{ matrix.platform.name == 'CMake' }}
with:
if-no-files-found: error
name: ${{ matrix.platform.artifact }}
path: build/dist/SDL3*
- uses: actions/upload-artifact@v3
if: ${{ matrix.platform.name == 'CMake' }}
with:
if-no-files-found: error
name: ${{ matrix.platform.apk-artifact }}
path: build/test/*.apk
56 changes: 56 additions & 0 deletions .github/workflows/cpactions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build (C/P Actions)

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
freebsd:
runs-on: ubuntu-latest
name: '${{ matrix.platform.name }} ${{ matrix.platform.os-version }}'
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
platform:
- { name: FreeBSD, os: freebsd, os-version: 13.2, os-arch: x86-64, artifact: SDL-freebsd-x64,
sdl-cmake-configure-arguments: '-DSDL_CHECK_REQUIRED_INCLUDES="/usr/local/include" -DSDL_CHECK_REQUIRED_LINK_OPTIONS="-L/usr/local/lib"',
setup-cmd: 'sudo pkg update',
install-cmd: 'sudo pkg install -y cmake ninja pkgconf libXcursor libXext libXinerama libXi libXfixes libXrandr libXScrnSaver libXxf86vm wayland wayland-protocols libxkbcommon mesa-libs libglvnd evdev-proto libinotify alsa-lib jackit pipewire pulseaudio sndio dbus zh-fcitx ibus libudev-devd',
}
- { name: NetBSD, os: netbsd, os-version: 9.3, os-arch: x86-64, artifact: SDL-netbsd-x64,
sdl-cmake-configure-arguments: '',
setup-cmd: 'export PATH="/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH";export PKG_CONFIG_PATH="/usr/pkg/lib/pkgconfig";export PKG_PATH="https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f "1 2" -d.)/All/";echo "PKG_PATH=$PKG_PATH";echo "uname -a -> \"$(uname -a)\"";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update',
install-cmd: 'sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1',
}
steps:
- uses: actions/checkout@v3
- name: Build
uses: cross-platform-actions/[email protected]
with:
operating_system: ${{ matrix.platform.os }}
architecture: ${{ matrix.platform.os-arch }}
version: ${{ matrix.platform.os-version }}
run: |
${{ matrix.platform.setup-cmd }}
${{ matrix.platform.install-cmd }}
cmake -S . -B build -GNinja \
-Wdeprecated -Wdev -Werror \
-DCMAKE_BUILD_TYPE=Release \
-DSDL_WERROR=ON \
${{ matrix.platform.sdl-cmake-configure-arguments }}
cmake --build build/ --config Release --verbose
cmake --build build/ --config Release --target package
cmake --build build/ --config Release --target clean
rm -rf build/dist/_CPack_Packages
rm -rf build/CMakeFiles
rm -rf build/docs
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: ${{ matrix.platform.artifact }}
path: build/dist/SDL3*
24 changes: 15 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
- { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64, artifact: 'SDL-msys2-clang64' }
- { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64, artifact: 'SDL-msys2-ucrt64' }
- { name: Ubuntu 20.04, os: ubuntu-20.04, shell: sh, artifact: 'SDL-ubuntu20.04' }
#- { name: Intel oneAPI (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-oneapi', intel: true,
# source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;'}
#- { name: Intel Compiler (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-icc', intel: true, cmake: '-DSDL_CLANG_TIDY=OFF',
# source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icc; export CXX=icpc; export CFLAGS=-diag-disable=10441; export CXXFLAGS=-diag-disable=10441; '}
- { name: Intel oneAPI (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-oneapi', intel: true,
source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;'}
- { name: Intel Compiler (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-icc', intel: true, cmake: '-DSDL_CLANG_TIDY=OFF',
source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icc; export CXX=icpc; export CFLAGS=-diag-disable=10441; export CXXFLAGS=-diag-disable=10441; '}
- { name: Ubuntu 22.04, os: ubuntu-22.04, shell: sh, artifact: 'SDL-ubuntu22.04' }
- { name: MacOS (Framework), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DSDL_FRAMEWORK=ON -DSDL_CLANG_TIDY=OFF', skip_test_pkgconfig: true, artifact: 'SDL-macos-framework', no-static: true }
- { name: MacOS (GNU prefix), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64" -DCLANG_TIDY_BINARY="$(brew --prefix llvm)/bin/clang-tidy"', artifact: 'SDL-macos-gnu' }
Expand Down Expand Up @@ -66,6 +66,8 @@ jobs:
- name: Setup Macos dependencies
if: runner.os == 'macOS'
run: |
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
brew update
brew install \
ninja \
pkg-config \
Expand All @@ -74,12 +76,16 @@ jobs:
- name: Setup Intel oneAPI
if: matrix.platform.intel
run: |
# Setup oneAPI repo
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
# Download the key to system keyring
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
# Add signed entry to apt sources and configure the APT client to use Intel repository:
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
# Update package list
sudo apt-get update -y
# Install oneAPI
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
Expand Down
102 changes: 102 additions & 0 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build (MSVC)

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
platform:
- { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64', artifact: 'SDL-VC-x64' }
- { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32', artifact: 'SDL-VC-x86' }
- { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON, artifact: 'SDL-VC-static-VCRT-x64' }
- { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON, artifact: 'SDL-VC-static-VCRT-x86' }
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64, artifact: 'SDL-clang-cl-x64' }
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32, artifact: 'SDL-clang-cl-x86' }
- { name: Windows (ARM), flags: -A ARM, artifact: 'SDL-VC-arm32', notests: true }
- { name: Windows (ARM64), flags: -A ARM64, artifact: 'SDL-VC-arm64', notests: true }
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0", nowerror: true, notests: true,
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0', artifact: 'SDL-VC-UWP' }

steps:
- uses: actions/checkout@v3
- name: Create CMake project using SDL as a subproject
shell: python
run: |
import os
import textwrap
srcdir = r"${{ github.workspace }}".replace("\\", "/")
builddir = f"{ srcdir }/build"
os.makedirs(builddir)
cmakelists_txt = textwrap.dedent(f"""\
# Always build .PDB symbol file
set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format")
set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables")
set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries")
cmake_minimum_required(VERSION 3.0...3.25)
project(sdl_user)
enable_testing()
add_subdirectory("{ srcdir }" SDL)
""")
print(cmakelists_txt)
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
f.write(cmakelists_txt)
- name: Configure (CMake)
run: cmake -S build -B build `
-Wdeprecated -Wdev -Werror `
-DSDL_WERROR=${{ !matrix.platform.nowerror }} `
-DSDL_SHARED=ON `
-DSDL_STATIC=ON `
-DSDL_TESTS=ON `
-DSDL_INSTALL_TESTS=ON `
-DSDL_VENDOR_INFO="Github Workflow" `
-DSDL_DISABLE_INSTALL=OFF `
-DSDL_DISABLE_INSTALL_CPACK=OFF `
-DSDL_DISABLE_INSTALL_DOCS=OFF `
${{ matrix.platform.flags }} `
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build (CMake)
id: build
run: |
cmake --build build/ --config Release --parallel
- name: Run build-time tests
if: ${{ !matrix.platform.notests }}
run: |
$env:SDL_TESTS_QUICK=1
ctest -VV --test-dir build/ -C Release -j2
- name: Install (CMake)
run: |
echo "SDL3_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
cmake --install build/
- name: Package (CPack)
if: ${{ always() && steps.build.outcome == 'success' }}
run: |
cmake --build build/ --config Release --target PACKAGE
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build `
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} `
${{ matrix.platform.flags }}
cmake --build cmake_config_build --config Release
- name: Add msbuild to PATH
if: ${{ matrix.platform.project != '' }}
uses: microsoft/[email protected]
- name: Build msbuild
if: ${{ matrix.platform.project != '' }}
run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}
- uses: actions/upload-artifact@v3
if: ${{ always() && steps.build.outcome == 'success' }}
with:
if-no-files-found: error
name: ${{ matrix.platform.artifact }}
path: build/dist/SDL3*
5 changes: 5 additions & 0 deletions .github/workflows/vita.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ jobs:
run: |
cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi
- name: Fix vita.toolchain.cmake
run: |
# cache PKG_CONFIG_PATH
sed -i -E 's/set\( PKG_CONFIG_EXECUTABLE "\$\{VITASDK}\/bin\/arm-vita-eabi-pkg-config" )/set( PKG_CONFIG_EXECUTABLE "${VITASDK}\/bin\/arm-vita-eabi-pkg-config" CACHE PATH "Path of pkg-config executable" )/' ${VITASDK}/share/vita.toolchain.cmake
- name: Configure (CMake)
run: |
cmake -S . -B build -G Ninja \
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ VisualC/tests/gamepadmap/button.bmp
VisualC/tests/gamepadmap/gamepadmap.bmp
VisualC/tests/gamepadmap/gamepadmap_back.bmp
VisualC/tests/loopwave/sample.wav
VisualC/tests/testautomation/CompareSurfaces0001_Reference.bmp
VisualC/tests/testautomation/CompareSurfaces0001_TestOutput.bmp
VisualC/tests/testautomation/*.bmp
VisualC/tests/testgamepad/axis.bmp
VisualC/tests/testgamepad/button.bmp
VisualC/tests/testgamepad/gamepadmap.bmp
Expand All @@ -80,6 +79,7 @@ VisualC/tests/testscale/sample.bmp
VisualC/tests/testsprite/icon.bmp
VisualC/tests/testyuv/testyuv.bmp
VisualC-GDK/**/Layout
VisualC-GDK/shaders/*.h

# for Android
android-project/local.properties
Expand Down
Loading

0 comments on commit fbe1cca

Please sign in to comment.