Skip to content

Commit

Permalink
Merge tag 'release-2.28.5' into mkxp-z-2.28.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Eblo committed Jun 12, 2024
2 parents 1b12cf8 + 15ead9a commit a82ea28
Show file tree
Hide file tree
Showing 114 changed files with 2,610 additions and 209,860 deletions.
2 changes: 1 addition & 1 deletion .github/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.0...3.5)
project(ci_utils C CXX)

set(txt "CC=${CMAKE_C_COMPILER}
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/vmactions.yml → .github/workflows/cpactions.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: Build (VM Actions)
name: Build (C/P Actions)

on: [push, pull_request]

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:
usesh: true
prepare: |
pkg install -y \
operating_system: freebsd
version: '13.2'
shell: bash
run: |
sudo pkg update
sudo pkg install -y \
gmake \
pkgconf \
libXcursor \
Expand All @@ -33,17 +37,15 @@ jobs:
libinotify \
alsa-lib \
jackit \
nas \
pipewire \
pulseaudio \
sndio \
dbus \
zh-fcitx \
ibus \
libsamplerate \
libudev-devd
run: |
mkdir build_autotools
(cd build_autotools && CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ../configure)
export CPPFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
(cd build_autotools && ../configure --disable-static)
gmake -C build_autotools -j`sysctl -n hw.ncpu` V=1
4 changes: 2 additions & 2 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mymindstorm/setup-emsdk@v10
- uses: mymindstorm/setup-emsdk@v12
with:
version: 2.0.32
version: 3.1.35
- name: Install ninja
run: |
sudo apt-get -y update
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ jobs:
- name: Run build-time tests (CMake)
if: "! matrix.platform.autotools"
run: |
set -eu
${{ 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/libSDL2-2.0.so.0 | grep SDL-
Expand All @@ -122,8 +122,8 @@ jobs:
- name: Configure (Autotools)
if: matrix.platform.autotools
run: |
set -eu
${{ matrix.platform.source_cmd }}
set -eu
rm -fr build-autotools
mkdir build-autotools
./autogen.sh
Expand Down Expand Up @@ -154,8 +154,8 @@ jobs:
- name: Build (Autotools)
if: matrix.platform.autotools
run: |
set -eu
${{ matrix.platform.source_cmd }}
set -eu
parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools V=1
if test "${{ runner.os }}" != "macOS" ; then
Expand All @@ -164,8 +164,8 @@ jobs:
- name: Run build-time tests (Autotools)
if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }}
run: |
set -eu
${{ matrix.platform.source_cmd }}
set -eu
curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)"
export SDL_TESTS_QUICK=1
Expand All @@ -177,8 +177,8 @@ jobs:
- name: Install (Autotools)
if: matrix.platform.autotools
run: |
set -eu
${{ matrix.platform.source_cmd }}
set -eu
curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools install V=1
Expand Down Expand Up @@ -219,8 +219,8 @@ jobs:
- name: Run installed-tests (Autotools)
if: "runner.os == 'Linux' && matrix.platform.autotools"
run: |
set -eu
${{ matrix.platform.source_cmd }}
set -eu
parallel="$(getconf _NPROCESSORS_ONLN)"
sudo make -j"${parallel}" -C build-autotools install
sudo make -j"${parallel}" -C build-autotools/test install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
os.makedirs(builddir)
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
f.write(textwrap.dedent(f"""\
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.0...3.5)
project(sdl_user)
add_subdirectory("{ srcdir }" SDL)
"""))
Expand All @@ -53,7 +53,7 @@ jobs:
if: "! contains(matrix.platform.name, 'ARM')"
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 "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
Expand Down
58 changes: 45 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the SDL source code and run \"cmake -S ${CMAKE_SOURCE_DIR} -B .\" from there")
endif()

# MSVC runtime library flags are selected by an abstraction.
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)

cmake_minimum_required(VERSION 3.0.0...3.5)
project(SDL2 C CXX)

Expand Down Expand Up @@ -84,7 +87,7 @@ endif()
# See docs/release_checklist.md
set(SDL_MAJOR_VERSION 2)
set(SDL_MINOR_VERSION 28)
set(SDL_MICRO_VERSION 1)
set(SDL_MICRO_VERSION 5)
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")

# Set defaults preventing destination file conflicts
Expand Down Expand Up @@ -224,11 +227,13 @@ elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+
elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$")
set(OPT_DEF_ASM TRUE)
set(USE_INTELCC TRUE)
elseif(CMAKE_C_COMPILER_ID MATCHES "QCC")
set(USE_QCC TRUE)
else()
set(OPT_DEF_ASM FALSE)
endif()

if(USE_GCC OR USE_CLANG OR USE_INTELCC)
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
set(OPT_DEF_GCC_ATOMICS ON)
endif()

Expand All @@ -253,6 +258,9 @@ endif()
if(MSVC)
option(SDL_FORCE_STATIC_VCRT "Force /MT for static VC runtimes" OFF)
if(SDL_FORCE_STATIC_VCRT)
if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
Expand Down Expand Up @@ -563,7 +571,7 @@ if(NOT SDL_FOREGROUNDING_SIGNAL STREQUAL "OFF")
endif()

# Compiler option evaluation
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
# Check for -Wall first, so later things can override pieces of it.
# Note: clang-cl treats -Wall as -Weverything (which is very loud),
# /W3 as -Wall, and /W4 as -Wall -Wextra. So: /W3 is enough.
Expand Down Expand Up @@ -620,11 +628,6 @@ if(USE_GCC OR USE_CLANG OR USE_INTELCC)
endif()
endif()

set(CMAKE_REQUIRED_FLAGS "-mpreferred-stack-boundary=2")
check_c_source_compiles("int x = 0; int main(int argc, char **argv) { return 0; }"
HAVE_GCC_PREFERRED_STACK_BOUNDARY)
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})

set(CMAKE_REQUIRED_FLAGS "-fvisibility=hidden -Werror")
check_c_source_compiles("
#if !defined(__GNUC__) || __GNUC__ < 4
Expand Down Expand Up @@ -1427,6 +1430,12 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
file(GLOB AIX_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/paudio/*.c)
list(APPEND SOURCE_FILES ${AIX_AUDIO_SOURCES})
set(HAVE_SDL_AUDIO TRUE)
elseif(QNX)
set(SDL_AUDIO_DRIVER_QSA 1)
file(GLOB QSA_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/qsa/*.c)
list(APPEND SOURCE_FILES ${QSA_AUDIO_SOURCES})
list(APPEND EXTRA_LIBS asound)
set(HAVE_SDL_AUDIO TRUE)
endif()
CheckOSS()
CheckALSA()
Expand Down Expand Up @@ -1458,6 +1467,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
set(SDL_VIDEO_VULKAN 1)
set(HAVE_VULKAN TRUE)
endif()
CheckQNXScreen()
endif()

if(UNIX)
Expand Down Expand Up @@ -1708,6 +1718,13 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
set(HAVE_RPATH TRUE)
endif()

if(QNX)
# QNX's *printf() family generates a SIGSEGV if NULL is passed for a string
# specifier (on purpose), but SDL expects "(null)". Use the built-in
# implementation.
set(HAVE_VSNPRINTF 0)
set(USE_POSIX_SPAWN 1)
endif()
elseif(WINDOWS)
find_program(WINDRES windres)

Expand Down Expand Up @@ -1766,7 +1783,7 @@ elseif(WINDOWS)
check_include_file(ddraw.h HAVE_DDRAW_H)
check_include_file(dsound.h HAVE_DSOUND_H)
check_include_file(dinput.h HAVE_DINPUT_H)
if(WINDOWS_STORE OR CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
if(WINDOWS_STORE OR SDL_CPU_ARM32)
set(HAVE_DINPUT_H 0)
endif()
check_include_file(dxgi.h HAVE_DXGI_H)
Expand Down Expand Up @@ -1926,7 +1943,7 @@ elseif(WINDOWS)

# Libraries for Win32 native and MinGW
if(NOT WINDOWS_STORE)
list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32)
list(APPEND EXTRA_LIBS kernel32 user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32)
endif()

if(WINDOWS_STORE)
Expand Down Expand Up @@ -3066,9 +3083,17 @@ else()
set(sdl_static_libname "SDL2")
endif()

set(prefix ${CMAKE_INSTALL_PREFIX})
# CMAKE_PREFIX_PATH and CMAKE_INSTALL_FULL_BINDIR can be a non-absolute path
# when a master-project does e.g. `set(CMAKE_INSTALL_PREFIX "libs/SDL2" CACHE PATH "prefix" FORCE)`.
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}")
endif()
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_FULL_BINDIR}")
set(CMAKE_INSTALL_FULL_BINDIR "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_FULL_BINDIR}")
endif()
file(RELATIVE_PATH bin_prefix_relpath "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_PREFIX}")

set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
set(bindir "\${exec_prefix}/${CMAKE_INSTALL_BINDIR}")
Expand Down Expand Up @@ -3187,7 +3212,7 @@ if (SDL_ASAN)
endif()

if(SDL_CCACHE AND NOT CMAKE_VERSION VERSION_LESS 3.4)
cmake_minimum_required(VERSION 3.4)
cmake_minimum_required(VERSION 3.4...3.5)
find_program(CCACHE_BINARY ccache)
if(CCACHE_BINARY)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY})
Expand Down Expand Up @@ -3312,6 +3337,12 @@ if(ANDROID)
endif()

if(APPLE)
cmake_push_check_state(RESET)
check_c_compiler_flag(-fobjc-arc COMPILER_SUPPORTS_FOBJC_ARC)
cmake_pop_check_state()
if(NOT COMPILER_SUPPORTS_FOBJC_ARC)
message(FATAL_ERROR "Compiler does not support -fobjc-arc: this is required on Apple platforms")
endif()
target_compile_options(sdl-build-options INTERFACE "-fobjc-arc")
endif()

Expand All @@ -3334,6 +3365,7 @@ if(SDL_SHARED)
# alias target for in-tree builds
add_library(SDL2::SDL2 ALIAS SDL2)
set_target_properties(SDL2 PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
set_target_properties(SDL2 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE)
if(NOT SDL_LIBC)
if(SDL_CPU_X86)
# FIXME: should be added for all architectures (missing symbols for ARM)
Expand Down Expand Up @@ -3368,7 +3400,7 @@ if(SDL_SHARED)
OUTPUT_NAME "SDL2")
endif()
# Note: The clang toolset for Visual Studio does not support /NODEFAULTLIB.
if(MSVC AND NOT SDL_LIBC AND NOT MSVC_CLANG AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
if(MSVC AND NOT SDL_LIBC AND NOT MSVC_CLANG AND NOT SDL_CPU_ARM32)
# Don't try to link with the default set of libraries.
if(NOT WINDOWS_STORE)
set_property(TARGET SDL2 APPEND_STRING PROPERTY LINK_FLAGS " /NODEFAULTLIB")
Expand Down
2 changes: 1 addition & 1 deletion Makefile.os2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 28
MICRO_VERSION = 1
MICRO_VERSION = 5
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
DESCRIPTION = Simple DirectMedia Layer 2

Expand Down
2 changes: 1 addition & 1 deletion Makefile.w32
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 28
MICRO_VERSION = 1
MICRO_VERSION = 5
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)

LIBHOME = .
Expand Down
2 changes: 1 addition & 1 deletion VisualC/pkg-support/cmake/sdl2-config.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SDL2 CMake configuration file:
# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.0...3.5)

include(FeatureSummary)
set_package_properties(SDL2 PROPERTIES
Expand Down
7 changes: 7 additions & 0 deletions WhatsNew.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

This is a list of major changes in SDL's version history.

---------------------------------------------------------------------------
2.28.2:
---------------------------------------------------------------------------
General:
* Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers


---------------------------------------------------------------------------
2.28.0:
---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions Xcode/SDL/Info-Framework.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.28.1</string>
<string>2.28.5</string>
<key>CFBundleSignature</key>
<string>SDLX</string>
<key>CFBundleVersion</key>
<string>2.28.1</string>
<string>2.28.5</string>
</dict>
</plist>
Loading

0 comments on commit a82ea28

Please sign in to comment.