Commit Graph

385 Commits (ad272ac6901e979e7431d72629e3189727eed037)

Author SHA1 Message Date
Anonymous Maarten ad272ac690 Set POSITION_INDEPENDENT_CODE property on SDL2 for CMake 3.0 2022-06-07 18:44:47 -07:00
chalonverse 7a335df9cf Updated CMakeLists.txt and configure.asc/script so that it checks for the required Windows SDK version before it enables the d3d12 renderer. Also fixed reported warnings in some builds. 2022-06-07 17:07:33 -07:00
Anonymous Maarten 5abd676917 Allow empty default values to the dep_option macro 2022-06-07 09:17:44 -07:00
chalonverse 4082821822
DirectX 12 Renderer (#5761)
* DirectX 12 Renderer (27 squashed commits)

* Add missing SDL_hidapi.h of merge of SDL.vcxproj.filters

* Fixed OpenWatcom build failure

* Dynapi fix

Co-authored-by: Ryan C. Gordon <icculus@icculus.org>
2022-06-06 17:42:30 -07:00
Anonymous Maarten fd3f381021 Initialize SDL_STATIC_PIC from CMAKE_POSITION_INDEPENDENT_CODE 2022-06-03 21:05:04 -07:00
Simon McVittie 65a3453b7f build: Compile with large inode number support where possible
On filesystems with large inode numbers, such as overlayfs, attempting
to stat() a file on a 32-bit system using legacy syscalls can fail
with EOVERFLOW. If we opt-in to more modern "large file support"
syscalls, then source code references to functions like stat() are
transparently replaced with ABIs that support large file sizes and
inode numbers, such as stat64().

This cannot safely be done globally by Linux distributions, because
some libraries expose types like `off_t` or `struct stat` in their
ABI, meaning that enabling large file support would be an incompatible
change that would cause crashes. However, SDL appears to be careful to
avoid these types in header files, so it should be OK to enable this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-03 21:03:50 -07:00
Anonymous Maarten 799d39a302 Make the sdl2-config script relocatable 2022-06-03 16:27:13 -07:00
Anonymous Maarten 5ec2d46f47 cmake: make SDL2Config.cmake compatible with autotools' sdl2-config.cmake 2022-06-03 12:41:36 -07:00
Anonymous Maarten 8e13cc309e cmake: add 'compatible interface properties' to allow enforcing SDL2 sharedness 2022-06-03 12:41:36 -07:00
Anonymous Maarten 1087eaad7e cmake: install SDL2::SDL2test when configuring with SDL2_TEST enabled 2022-06-03 12:41:36 -07:00
Tim Schumacher 12cc636c8f Make sdl2-config prefixes configurable again
The installation prefix ended up being hard-coded into the
`sdl2-config` script after the placeholders were accidentally removed
in 6956f4aa19.
2022-05-22 17:30:04 +03:00
Sam Lantinga 6da6a6cba2 Make sure Objective C files are built with the same flags as C files.
Fixes https://github.com/libsdl-org/SDL/issues/5707
2022-05-21 13:51:21 -07:00
Cameron Cawley e0f3da497f Remove unused SDL_ASSEMBLY_ROUTINES define 2022-05-12 14:37:00 +03:00
Alex Szpakowski ec8fa57750 macOS: always use Objective-C ARC (automatic ref counting).
Change Cocoa SDL_VideoData and SDL_WindowData implementations from C structs to Objective-C objects, since bridging between C and ObjC is easier that way.
2022-05-09 21:53:40 -07:00
Cameron Cawley 9ef6885743 Fix MSVC ARM32 builds 2022-05-08 18:21:02 +03:00
Sam Lantinga 0c19602118 Applied 0004-Define-crt-macros.patch.txt from vcpkg ports 2022-05-06 07:59:36 -07:00
Simon McVittie 38ef678990 test: Add a `make install` target for the tests
This makes it more convenient to compile them alongside SDL, install
them in an optional package and use them as smoke-tests or diagnostic
tools. The default installation directory is taken from GNOME's
installed-tests, which seems as good a convention as any other:
https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 18:17:55 -07:00
Simon McVittie 7d2808e30b test: Run selected noninteractive tests at build-time
In Autotools, these are run by `make -C ${builddir}/test check`.
In CMake, they're run by `make -C ${builddir} test` or
`ninja -C ${builddir} test` or `ctest --test-dir ${builddir}`.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 18:17:55 -07:00
Simon McVittie fff97c95eb build: Mechanically generate ABI versions from version number
If we're strict about applying something resembling semantic versioning
to the "marketing" version number, then we can mechanically generate
the ABI version from it.

This limits the range of valid micro versions (patchlevels) to 0-99.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie cd7c2f1de7 Switch versioning scheme to be the same as GLib and Flatpak
For stable releases, this gives us the ability to make bugfix-only point
releases such as 2.24.1 if we want to, and distinguish between them
programmatically. For example, this ability could have been useful after
2.0.16 to fix Xwayland regressions, and after 2.0.18 to fix event loop
regressions.

For development releases, this gives us the ability to make multiple
prereleases during the same feature cycle, and distinguish between them
programmatically. For example, this would have been useful during 2.0.22
development, which went through three prereleases before reaching the
final release.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie 63814ec767 Add static assertions that the version number is consistent
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie 22002d9155 docs/release_checklist.md: Document how/where to bump version numbers
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie 2021a10927 cmake: Defer test subproject until after defining install/uninstall
It looks as though something in the test subproject "leaks" into the
main build system, causing us to try to install ${builddir}/test/sdl2.pc
instead of the correct ${builddir}/sdl2.pc. Moving the tests subproject
further down avoids this.

Resolves: https://github.com/libsdl-org/SDL/issues/5604
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:36:21 -07:00
Ryan C. Gordon 7d7ec9c951
x11: Remove XVidMode and Xinerama support.
Fixes #1782.
2022-04-26 23:17:13 -04:00
Ozkan Sezer e9ff4fdd49 add SDL_bsearch 2022-04-26 04:03:25 +03:00
Sam Lantinga fa29e2d7f7 Updated to version 2.0.23 for development 2022-04-25 13:45:51 -07:00
Ryan C. Gordon 634b9edc7f
cmake: Fixed indenting and some oldschool `endif(TEXT)` things. 2022-04-15 20:50:55 -04:00
Semphris dc5bc5237c Added CMake option to disable the installer 2022-04-15 20:48:40 -04:00
Ivan Epifanov b75996138a Vita: fix VIDEO_VITA_PVR flag 2022-04-11 17:16:22 -04:00
Sam Lantinga 505d6a4a05 Update version to 2.0.22 for release 2022-04-08 18:18:56 -07:00
Ozkan Sezer c0bb39e5e9 check for HAVE_ROAPI_H in cmake and autotools, and
update SDL_config_windows.h and SDL_config_winrt.h
2022-04-02 02:50:02 +03:00
Jaylon Gowie 8c542a3591 Desktop OpenGL 1.X/2.X PSVita Support 2022-03-31 00:02:56 -04:00
Ivan Epifanov cbdb67b4f6 Vita: add SDL_GetPreferredLocales support 2022-03-29 15:02:21 -07:00
Ivan Epifanov 178ac19615 Vita: add audio capture support 2022-03-29 14:12:37 -07:00
Sam Lantinga d3cc5764c0 Modern CMake doesn't need "LANGUAGE C" for Objective-C
CMake 3.19 fails to compile Objective-C with that property set

Fixes https://github.com/libsdl-org/SDL/issues/5418
2022-03-18 07:36:16 -07:00
pionere 85dff3e453 emscripten: obey enable-misc/SDL_MISC settings 2022-03-16 14:55:28 +03:00
Ozkan Sezer 61a93d3c46 minor whitespace cleanup. 2022-03-15 23:10:02 +03:00
Ryan C. Gordon 3ab739afff
cmake: Make test code use proper C main functions.
Fixes #5021.
2022-03-13 12:10:52 -04:00
Ozkan Sezer 4a43321c81 cmake: Fix bug #5361.
src/joystick/*.c wasn't unconditionally added to source list even though
joystick is an SDL subsystem. Also removed the `SDL_JOYSTICK AND NOT APPLE`
condition from src/joystick/dummy/*.c source addition: the OSX unresolved
symbols issue, if it really is there, should be fixed separately.

Fixes https://github.com/libsdl-org/SDL/issues/5361, i.e. build failures
when SDL_JOYSTICK and SDL_HAPTIC are disabled.
2022-02-23 18:10:02 +03:00
Ozkan Sezer b5614d0c6e cmake: fix UWP joystick.
from: https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/0005-Fix-uwp-joystick.patch
2022-02-04 20:05:14 +03:00
pionere ff2d62d89f dlopen is not a subsystem 2022-01-28 20:40:19 -05:00
pionere fa8075c4fc add audio/video dummies if nothing else available 2022-01-28 20:40:19 -05:00
pionere 39c723fc9c fix HAVE_SDL_VIDEO flag of CMakeLists.txt [IOS OR TVOS] 2022-01-28 20:40:19 -05:00
pionere 3dba2a73f1 fix HAVE_SDL_AUDIO flag of CMakeLists.txt II. 2022-01-28 20:40:19 -05:00
pionere 3936af99d8 fix HAVE_SDL_AUDIO flag of CMakeLists.txt 2022-01-28 20:40:19 -05:00
pionere 21510387cf fix CMakeLists.txt vs. configure inconsistencies
- atomic subsystem is disabled by default (changed in configure)
- SDL_WAYLAND_LIBDECOR is disabled by default if SDL_WAYLAND is not set (changed in CMakeLists.txt)
2022-01-28 20:40:19 -05:00
pionere 11cdde01f3 fix MacOS build with disabled SDL_SENSOR
+ get rid of the double-check (SDL_HAPTIC depends on SDL_JOYSTICK)
2022-01-28 20:40:19 -05:00
pionere 176941a4fb allow MacOS build without SDL_FILE 2022-01-28 20:40:19 -05:00
pionere eb80f2c65a sync handling of subsystems II. 2022-01-28 20:40:19 -05:00
pionere 65e9415b98 sync handling of subsystems
- add DUMMY-define in case the subsystem is enabled but not available (filesystem/misc/locale)
- add missing PSP/VITA-filesystem defines
- sync the order of filesystems in SDL_config.h.cmake/in
- add option to disable locale subsystem in configure
2022-01-28 20:40:19 -05:00