Skip to content

Commit

Permalink
Merge branch 'libsdl-org:main' into abxy-nsew
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken authored Nov 6, 2023
2 parents 5ff34b3 + c6d9fb1 commit 579791f
Show file tree
Hide file tree
Showing 470 changed files with 20,435 additions and 11,034 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/vmactions.yml → .github/workflows/cpactions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build (VM Actions)
name: Build (C/P Actions)

on: [push, pull_request]

Expand All @@ -8,17 +8,19 @@ concurrency:

jobs:
freebsd:
runs-on: macos-12
runs-on: ubuntu-latest
name: FreeBSD
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Build
uses: vmactions/freebsd-vm@v0
uses: cross-platform-actions/action@v0.19.1
with:
mem: 8192
usesh: true
prepare: |
pkg install -y \
operating_system: freebsd
version: '13.2'
run: |
sudo pkg update
sudo pkg install -y \
cmake \
ninja \
pkgconf \
Expand All @@ -45,11 +47,8 @@ jobs:
dbus \
zh-fcitx \
ibus \
libsamplerate \
libudev-devd
run: |
cmake -S . -B build -GNinja \
cmake -S . -B build -GNinja \
-Wdeprecated -Wdev -Werror \
-DCMAKE_BUILD_TYPE=Release \
-DSDL_HIDAPI_LIBUSB=OFF \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=prefix \
-GNinja
- name: Build (CMake)
Expand All @@ -42,11 +42,11 @@ jobs:
cmake --install build/
- name: Package (CPack)
run: |
cmake --build build/ --config Release --target package
cmake --build build/ --config Debug --target package
- name: Verify CMake configuration files
run: |
emcmake cmake -S cmake/test -B cmake_config_build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=Debug \
-DSDL_VENDOR_INFO="Github Workflow" \
-DTEST_SHARED=FALSE \
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }}
Expand Down
16 changes: 10 additions & 6 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 All @@ -43,6 +43,7 @@ jobs:
${{ matrix.platform.msys-env }}-cc
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-ninja
${{ matrix.platform.msys-env }}-perl
${{ matrix.platform.msys-env }}-pkg-config
${{ matrix.platform.msys-env }}-clang-tools-extra
Expand All @@ -52,7 +53,7 @@ jobs:
sudo apt-get update
sudo apt-get install build-essential git \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \
libaudio-dev libjack-dev libsndio-dev libusb-1.0-0-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
Expand Down Expand Up @@ -103,6 +104,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.platform.cmake }}
- name: Build (CMake)
id: build
run: |
${{ matrix.platform.source_cmd }}
cmake --build build/ --config Release --verbose --parallel
Expand All @@ -111,7 +113,7 @@ jobs:
${{ matrix.platform.source_cmd }}
set -eu
export SDL_TESTS_QUICK=1
ctest -VV --test-dir build/
ctest -VV --test-dir build/ -j2
if test "${{ runner.os }}" = "Linux"; then
# This should show us the SDL_REVISION
strings build/libSDL3.so.0 | grep SDL-
Expand All @@ -123,6 +125,7 @@ jobs:
cmake --install build/ --config Release
( cd cmake_prefix; find . ) | LC_ALL=C sort -u
- name: Package (CPack)
if: ${{ always() && steps.build.outcome == 'success' }}
run: |
cmake --build build/ --config Release --target package
- name: Verify CMake configuration files
Expand All @@ -141,6 +144,7 @@ jobs:
export PKG_CONFIG_PATH=$(echo "${{ github.workspace }}/cmake_prefix/lib/pkgconfig" | sed -e 's#\\#/#g')
cmake/test/test_pkgconfig.sh
- uses: actions/upload-artifact@v3
if: ${{ always() && steps.build.outcome == 'success' }}
with:
if-no-files-found: error
name: ${{ matrix.platform.artifact }}
Expand Down
36 changes: 24 additions & 12 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
- { 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' }
- { name: Windows (ARM64), flags: -A ARM64, artifact: 'SDL-VC-arm64' }
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF, nowerror: true,
- { 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:
Expand All @@ -36,12 +36,20 @@ jobs:
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(textwrap.dedent(f"""\
cmake_minimum_required(VERSION 3.0)
project(sdl_user)
add_subdirectory("{ srcdir }" SDL)
"""))
f.write(cmakelists_txt)
- name: Configure (CMake)
run: cmake -S build -B build `
-Wdeprecated -Wdev -Werror `
Expand All @@ -53,24 +61,27 @@ jobs:
-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)
run: cmake --build build/ --config Release --parallel
id: build
run: |
cmake --build build/ --config Release --parallel
- name: Run build-time tests
if: "! contains(matrix.platform.name, 'ARM')"
if: ${{ !matrix.platform.notests }}
run: |
$env:SDL_TESTS_QUICK=1
ctest -VV --test-dir build/ -C Release
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
if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP
run: |
cmake -S cmake/test -B cmake_config_build `
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} `
Expand All @@ -84,6 +95,7 @@ jobs:
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 }}
Expand Down
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
1 change: 1 addition & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
$(wildcard $(LOCAL_PATH)/src/core/*.c) \
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
Expand Down
Loading

0 comments on commit 579791f

Please sign in to comment.