Commit Graph

835 Commits

Author SHA1 Message Date
Anonymous Maarten 937f5d0059 cmake: allow man page installation by SDL satellite libraries
This is done by installing the wikiheaders.pl script, and add a wrapping cmake function.
2023-06-27 03:00:19 +02:00
Sam Lantinga e72935a445 Check for modff in addition to modf 2023-06-15 16:43:35 -07:00
Sam Lantinga 2e465ae31b Revert "Added SDL_nextafter() and SDL_nextafterf()"
This reverts commit bc5d074818.

It's not clear that we need these yet, so I'm going to remove them for now.
2023-06-14 11:05:10 -07:00
Sam Lantinga bc5d074818 Added SDL_nextafter() and SDL_nextafterf() 2023-06-13 10:32:21 -07:00
Anonymous Maarten 76a919d458 cmake: don't force enable/disable SDL_HIDAPI_LIBUSB
Use CMakeDependentOption instead to configure SDL_HIDAPI_LIBUSB to a okay-ish variable.
2023-05-28 03:27:20 +02:00
Sam Lantinga 6c28546828 Added SDL_wcstol() 2023-05-26 08:19:04 -07:00
Sam Lantinga 7602a3181e Allow declarations after statements
The SDL coding standard is C89 plus C++ style comments and mixed code and declarations.
2023-05-26 08:19:04 -07:00
Sam Lantinga 65180804c4 Disable unused local typedefs warning
This triggers on gcc 4.8.4 for compile time asserts inside of functions

Fixes https://github.com/libsdl-org/SDL/issues/7732
2023-05-23 17:23:30 -07:00
Ryan C. Gordon e474047ff8 rwlock: Added SDL_rwlock API for shared locks. 2023-04-27 21:54:02 -04:00
Ryan C. Gordon e5a6c24c82 audio: Redesigned audio conversion code for SDL3.
- SDL_AudioCVT is gone, even internally.
- libsamplerate is gone (I suspect our resampler is finally Good Enough).
- Cleanups and improvements to audio conversion interfaces.
- SDL_AudioStream can change its input/output format/rate/channels on the fly!
2023-04-27 18:35:15 -04:00
Anonymous Maarten 029e61a07e cmake: split SDL_NEON into SDL_NEON and SDL_NEON_BLITTERS 2023-04-04 15:55:02 -07:00
Anonymous Maarten b99f380498 intrinsics: add lsx/lasx intrinsic headers when not disabled
__attribute__((target(xx))) is not supported by LoongArch64.
The following warning is emitted:
target attribute is not supported on this machine [-Wattributes]
2023-03-30 04:00:48 +02:00
Anonymous Maarten 3472dc11d6
Fix uses of undefined macro identifiers (-Wundef)
* Fix -Wundef warnings due to use of unguarded SDL_LOADSO_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WINDOWS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_ANDROID

* Fix -Wundef warnings due to use of unguarded SDL_LOADSO_DUMMY

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_COCOA

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_UIKIT

* Fix -Wundef warnings due to use of unguarded SDL_TIMERS_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_EVENTS_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_TIMER_DUMMY

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_SENSOR_DISABLED

* Fix -Wundef warnings due to use of unguarded __ANDROID__

* Fix -Wundef warnings due to use of unguarded __IOS__

* Fix -Wundef warnings due to use of unguarded EMULATE_CAS

* Fix -Wundef warnings due to use of unguarded SDL_ATOMIC_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_THREADS_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_SNDIO

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_NETBSD

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_WASAPI

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DSOUND

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_HAIKU

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_COREAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_AAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_OPENSLES

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_ANDROID

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PS2

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_VITA

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_N3DS

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_NEON_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_ALTIVEC_BLITTERS

* Fix -Wundef warnings due to use of unguarded __VITA__

* Fix -Wundef warnings due to use of unguarded __3DS__

* Fix -Wundef warnings due to use of unguarded SDL_DYNAPI_PROC_NO_VARARGS

* Fix -Wundef warnings due to use of unguarded __APPLE__

* Fix -Wundef warnings due to use of unguarded __WINRT__

* Fix -Wundef warnings due to use of unguarded SDL_HIDAPI_DISABLED

* Fix -Wundef warnings due to use of unguarded __TVOS__

* Fix -Wundef warnings due to use of unguarded HAVE_DRIVER_BACKEND

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_XINPUT

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_WGI

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_DINPUT

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_MFI

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_PS2

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_PSP

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_VITA

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_N3DS

* Fix -Wundef warnings due to use of unguarded __MACOS__

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WINRT

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RPI

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PVR_OGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VIVANTE

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D11

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D12

* Fix -Wundef warnings due to use of unguarded SDL_RENDER_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_METAL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_PS2

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_VITA_GXM

* Fix -Wundef warnings due to use of unguarded SDL_ARM_SIMD_BLITTERS

* Fix -Wundef warnings due to use of unguarded SDL_ARM_NEON_BLITTERS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_HAIKU

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_PS2

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VITA

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_N3DS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_KMSDRM

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RISCOS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_NGAGE

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_METAL

* Fix -Wundef warnings due to use of unguarded SDL_LSX_INTRINSICS

* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_NP_H

* Fix -Wundef warnings due to use of unguarded __RISCOS__

* Fix -Wundef warnings due to use of unguarded FAKE_RECURSIVE_MUTEX

* Fix -Wundef warnings due to use of unguarded USE_POSIX_SPAWN

* textureData is only needed when SDL is built with YUV support

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_ALSA

* Fix -Wundef warnings due to use of unguarded SDL_SSE3_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE4_2_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE4_1_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_AVX512F_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE2_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_AVX_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_AVX2_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_MMX_INTRINSICS

* Fix -Wundef warnings due to use of unguarded HAVE_CLOCK_GETTIME

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DISK

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DUMMY

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_DUMMY

* Fix -Wundef warnings due to use of unguarded HAVE_GCC_ATOMICS

* Fix -Wundef warnings due to use of unguarded HAVE_GCC_SYNC_LOCK_TEST_AND_SET

* Fix -Wundef warnings due to use of unguarded SDL_USE_LIBDBUS

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_JACK

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_VIRTUAL

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_LINUX

* Fix -Wundef warnings due to use of unguarded HAVE_LIBC

* Fix -Wundef warnings due to disabling SDL_LIBC

* Fix -Wundef warnings due to use of unguarded HAVE_PLATFORM_BACKEND

* Fix -Wundef warnings due to use of unguarded DEBUG

* Fix -Wundef warnings due to use of unguarded HAVE_LINUX_INPUT_H

* Fix -Werror=unused-variable when building with SDL_LIBC=OFF

* Fix -Wundef warnings due to use of unguqrded SDL_USE_LIBUDEV

* Use SDL alloc functions in libusb/hid.c

* Fix -Wundef warnings due to use of unguarded HAVE_LIBUDEV_H

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VULKAN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_OFFSCREEN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_OGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_GLX

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES2

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_OGL_ES2

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_OSS

* Remove SDL_AUDIO_DRIVER_SUNAUDIO reference since it is never set

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PIPEWIRE

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PULSEAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XCURSOR

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XDBE

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XFIXES

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XINPUT2

* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH

* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XRANDR

* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XSCRNSAVER

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XSHAPE

* Don't call XShape functions when XShape is diabled

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WAYLAND

* Fix -Wundef warnings due to use of unuarded SDL_VIDEO_DRIVER_X11

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RISCOS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_EGL

* Disable array when compiled with SDL_EVENTS=OFF

* Fix -Wundef warnings due to use of unguarded SDL_INPUT_LINUXEV

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_WINDOWS

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PS2

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PSP

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_VITA

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_N3DS

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_STDCPP

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_NGAGE

* Fix -Wundef warnings due to use of unguarded __WINDOWS__

* Fix -Wundef warnings due to use of unguarded __WINGDK__

* Fix -Wundef warnings due to use of unguarded __ANDROID__

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_GENERIC_COND_SUFFIX

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PIB

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PVR

* Fix -Wundef warnings due to use of unguarded SDL_FILE_DISABLED

* Fix -Wundef warnings due to use of unguarded __XBOXONE__

* Fix -Wundef warnings due to use of unguarded __XBOXSERIES__

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_WGL

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_QNX

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DISK

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_QNX

* Fix -Wundef warnings due to use of unguarded DEBUG_RAZOR

* Fix -Wundef warnings due to use of unguarded WINAPI_FAMILY_PHONE_APP

* Fix -Wundef warnings due to use of unguarded SDL_MAC_NO_SANDBOX

* Fix -Wundef warnings due to use of unguarded __(IPHONE|APPLETV|MAC)_OS_VERSION_MAX_ALLOWED

* Fix C4090 warning ('function': different 'const' qualifiers)

* ci: use -isystem for include dirs of pspdev toolchain

* cmake: add -Wundef option

* Fix remaining -Wundef warnings due to use of unguarded SDL_VIDEO_VULKAN and SDL_VIDEO_METAL

* Fix -Wundef warnings due to use of unguarded __MACOS__

* DEBUG_CONVERT is guaranteed to be defined in src/audio/SDL_audiocvt.c

* Fix -Wundef warnings due to use of unguarded HAVE_NANOSLEEP

* Fix -Wundef warnings due to use of unguarded HAVE_DXGI_H

* Fix -Wundef warnings due to use of unguarded HAVE_LINUX_INPUT_H

* fix SDL_VIDEO_DRIVER_WAYLAND

* fix SDL_VIDEO_DRIVER_X11

* Fix -Wundef warnings due to use of unguarded HAVE_MMDEVICEAPI_H

* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_SETNAME_NP

* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_SET_NAME_NP

* Fix -Wundef warnings due to use of unguarded HAVE_SETJMP

* Fix -Wundef warnings due to use of unguarded HAVE_SIGNAL_H

* Fix -Wundef warnings due to use of unguarded HAVE_TPCSHRD_H

* Fix -Wundef warnings due to use of unguarded MACOSX_COREAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_DINPUT

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_IOKIT

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_XINPUT

* Fix -Wundef warnings due to use of unguarded SDL_IPHONE_KEYBOARD

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_RAWINPUT

* Fix -Wundef warnings due to use of unguarded SDL_POWER_ANDROID

* Fix -Wundef warnings due to use of unguarded SDL_POWER_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_POWER_HAIKU

* Fix -Wundef warnings due to use of unguarded SDL_POWER_LINUX

* Fix -Wundef warnings due to use of unguarded SDL_POWER_MACOSX

* Fix -Wundef warnings due to use of unguarded SDL_POWER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_POWER_UIKIT

* Fix -Wundef warnings due to use of unguarded SDL_POWER_VITA

* Fix -Wundef warnings due to use of unguarded SDL_POWER_WINDOWS

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD_RECURSIVE_MUTEX

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VIVANTE_VDK

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WAYLAND

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_CGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_EGL

* Fix -Wundef warnings due to use of unguarded __MACOS__

* Fix -Wundef warnings due to use of unguarded __OpenBSD__

* Fix -Wundef warnings due to use of unguarded __FreeBSD__

* Fix -Wundef warnings due to use of unguarded __MWERKS__

* Fix -Wundef warnings due to use of unguarded __WIN32__

* Fix -Wundef warnings due to use of unguarded SDL_IPHONE_LAUNCHSCREEN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES2

* Remove unused HAVE_CONST, HAVE_INLINE and HAVE_VOLATILE

* Revert "Use SDL alloc functions in libusb/hid.c"

This reverts commit 847c64b00d.

* Handle FAKE_RECURSIVE_MUTEX in similar way as SDL2

* Don't use defined in macro
2023-03-29 21:49:01 +00:00
Elad Lahav 254f03388f Detect QCC as the compiler 2023-03-27 15:33:08 -07:00
Elad Lahav 60d95e2a77 Use posix_spawn() on QNX 2023-03-27 15:33:08 -07:00
Elad Lahav f352eeb90c Use the built-in version of vsnprintf() to support printing NULLs 2023-03-27 15:33:08 -07:00
Elad Lahav bc9e0bb7ad Switch from EXTRA_LIBS to SDL_EXTRA_LIBS 2023-03-27 15:33:08 -07:00
Elad Lahav 4374645738 Add QNX video and audio modules 2023-03-27 15:33:08 -07:00
Elad Lahav 292b80a13a Treat the QNX compiler as GCC for using atomics 2023-03-27 15:33:08 -07:00
Anonymous Maarten 9ada9daf51 SDL_blit_copy: Don't call potentially FPU using SDL_memcpy in SDL_memcpyMMX 2023-03-27 06:12:49 +00:00
Anonymous Maarten 37c9329db2 cmake: rename SDL_AVX512 -> SDL_AVX512F cmake option 2023-03-27 06:12:49 +00:00
Anonymous Maarten b0a5182e84 Sunset SDL_HasRDTSC 2023-03-27 06:12:49 +00:00
Anonymous Maarten 99a799ad8b cmake: add /Q_no-use-libirc flag when building a no-libc library
The new Intel LLVM compiler needs this when building SDL3
in release mode.
2023-03-27 06:12:49 +00:00
Anonymous Maarten 4be82202de cmake: new LLVM based Intel compiler does not recognize MSVC's /MP 2023-03-27 06:12:49 +00:00
Anonymous Maarten 51d96a1680 cmake: increase threshold for stack probes
The /Gs argument controls the number of bytes that local variables
can occupy before a stack probe is initiated.
By setting it to a huge value, no calls to __chkstk are inserted.

This change is needed for the classic Intel C compiler to build SDL
with -DSDL_LIBC=OFF.
2023-03-27 06:12:49 +00:00
Anonymous Maarten 29e19bf829 cmake: disable warnings in libm + warning about EMMS instruction
SDL_BlitCopyMMX ends with _mm_empty(), so the MMX state should be emptied.

(_mm_empty is the intrinsic function for emms)
2023-03-27 06:12:49 +00:00
Anonymous Maarten 345d1cd355 cmake: add support for building with Intel C compiler 2023-03-27 06:12:49 +00:00
Anonymous Maarten 97c3077678 cmake: detect rdtsc in CMake 2023-03-27 06:12:49 +00:00
Anonymous Maarten 0bd5ce13db cmake: add underscore in SSE4_1 and SSE4_2 options 2023-03-21 23:03:02 +03:00
Ozkan Sezer 8eb673d43d cmake: fix typo from previous commit. 2023-03-21 23:03:02 +03:00
Ozkan Sezer 6c9780720b cmake: added configuration options for AVX2, AVX512F, SSE4.1, and SSE4.2
adjusted SDL_intrin.h and testautomation_intrinsics.c accordingly.
2023-03-21 23:03:02 +03:00
Ozkan Sezer feec1305c6 cmake: remove duplicate setting of HAVE_ASSEMBLY to TRUE 2023-03-21 23:03:02 +03:00
Anonymous Maarten 905b892314 cmake: simplify mmx/sse/sse2/avx compiler support detection 2023-03-21 23:03:02 +03:00
Ozkan Sezer 69de6964e5 use target attributes of gcc / clang for SIMD code. 2023-03-21 23:03:02 +03:00
Anonymous Maarten cd7a3f8af5 cmake: generate and install man pages 2023-03-21 02:19:19 +01:00
Anonymous Maarten 65178df717 ci: test ARM neon and simd on ci using vita toolchain 2023-03-15 14:54:20 +01:00
Anonymous Maarten d27db3defa cmake+video: always use altivec.h header for detection + introduce SDL_ENABLE_ALTIVEC 2023-03-15 14:54:20 +01:00
Anonymous Maarten 3db3424b4e cmake: Detect powerpc architecture 2023-03-15 14:54:20 +01:00
Anonymous Maarten fc4085b54e cmake: Allow build system to disable arm neon intrinsics 2023-03-15 14:54:20 +01:00
Anonymous Maarten 46de6241d7 cmake: Allow build system to disable loongarch intrinsics 2023-03-15 14:54:20 +01:00
Anonymous Maarten 4681240241 cmake: Detect AVX + allow build system to disable Intel intrinsics 2023-03-15 14:54:20 +01:00
Anonymous Maarten 683411e96f cmake: only use precompile headers for C and CXX 2023-03-15 14:38:26 +01:00
Anonymous Maarten 7d55bbc0da cmake: get_filename_component(EXT) returns extension including leading dot 2023-03-15 14:38:26 +01:00
Guldoman ad95c93bf4 Add portal interface to support `SDL_GetSystemTheme` in linux 2023-03-09 15:05:16 -08:00
Anonymous Maarten c304fbded6 cmake: disable ccache by default 2023-03-09 20:24:03 +01:00
Anonymous Maarten 103fbcfc05 cmake: use compatible interface properties to disallow linking to a different version of SDL 2023-03-03 23:40:57 +01:00
Anonymous Maarten 02fede7c8c cmake: initialize SDL_SHARED and SDL_STATIC from BUILD_SHARED_LIBS 2023-02-28 02:15:39 +01:00
Anonymous Maarten dc138ee3d4 cmake: SDL3-shared target will always be a shared target 2023-02-17 23:42:03 +01:00
Anonymous Maarten 4d8a50912b cmake: no shared SDL libraries for riscos 2023-02-16 13:59:23 -08:00
Sam Lantinga bde4c738bb Don't build SDL as a static library by default
Linking with SDL dynamically allows end users to update SDL with bug fixes and new controller support and is recommended. This change makes it so SDL is dynamic by default and developers can build SDL themselves with a static option if that's something they need.
2023-02-16 13:59:23 -08:00
Ozkan Sezer c6792f78df look for clock_gettime() in libc first, then in librt if not found. 2023-02-13 11:23:12 -08:00
Anonymous Maarten 236d26b480 cmake: add `-F <SDL3-framework-parent-folder>` compile option in CMakeLists.txt 2023-02-13 05:26:57 +01:00
Anonymous Maarten ff82341ce9 cmake: allow find_package from build directory (requires CMake 3.26) 2023-02-09 17:20:28 -08:00
Anonymous Maarten b8adf90aa3 cmake: check again for unknown documentation commands 2023-02-09 17:20:28 -08:00
Anonymous Maarten cc0fa00049 cmake: include directories of (generated) dependencies as SYSTEM 2023-02-09 17:20:28 -08:00
Pierre Wendling fa8fba3812 Add clang-tidy config and CMake/CI support. 2023-02-06 21:02:25 -08:00
Anonymous Maarten 0a3d038ff7 cmake: fix installed SDL3::SDL3_test + test on ci 2023-01-31 05:29:38 +01:00
Anonymous Maarten 53d434fd24 cmake: add CPack support for creating binary archives 2023-01-31 01:59:21 +01:00
Anonymous Maarten 23c2c15a70 cmake: capitalize SDL3::Headers target 2023-01-31 01:59:21 +01:00
Anonymous Maarten 13c294eec3 cmake: add support for creating Apple frameworks with CMake 2023-01-31 01:59:21 +01:00
Anonymous Maarten 93c25e650c cmake: create SDL3::headers for include path + no exported CMake variables 2023-01-31 01:59:21 +01:00
Anonymous Maarten 5690dfb65b cmake: don't install Android.mk files for Android 2023-01-31 01:59:21 +01:00
Anonymous Maarten 09e2f83e17 cmake: no more SDL3_* cache variables 2023-01-31 01:59:21 +01:00
Anonymous Maarten 19d162281c cmake: detect cpu architecture in SDL_DetectCPUArchitecture
Stop looking for arch, when one is found
2023-01-31 01:59:21 +01:00
Anonymous Maarten 9cf34908a1 cmake: pass VERSION to project() + don't use SDL_VERSION 2023-01-31 01:59:21 +01:00
Anonymous Maarten 3aa456dead cmake: remove MSCOS_RPATH related FIXME
The Macos CI does not show any warnings, so assume it's fixed
2023-01-31 01:59:21 +01:00
Sam Lantinga 5970311353 Fixed build using clang-cl on Windows 2023-01-25 14:46:09 -08:00
Ozkan Sezer 3bf86c0eca cmake: addititonal check for visibility attributes.
makes sure to detect unsupported configurations especially with new gcc
versions.
2023-01-26 01:32:32 +03:00
Sam Lantinga 13087405e0 Fixed clang documentation warnings
Don't warn about \threadsafety, which was added as custom documentation for SDL functions

Also removed -Wdocumentation-unknown-command, since that triggers on the e-mail addresses in the generated wayland protocol headers.
2023-01-25 14:25:13 -08:00
Anonymous Maarten 4ec3a5ac27 cmake: only add <LANG>_VISIBILITY_PRESET properties when compiler supports -fvisibility= 2023-01-25 22:27:47 +01:00
Anonymous Maarten edf8db0466 cmake: removed unused code 2023-01-25 00:23:05 +01:00
Anonymous Maarten 5f995579e9 vita: add missing static libraries for using gles with pib 2023-01-25 00:23:05 +01:00
Anonymous Maarten bb3a60bce5 cmake: move include(sdlfind.cmake) to main cmake script 2023-01-25 00:23:05 +01:00
Anonymous Maarten 3e3debf9de vita: allow GLES support without GL support 2023-01-25 00:23:05 +01:00
Anonymous Maarten 3cb819ac48 vita: fix PVR_PSP2 (GLES) + gl4es4fita (GL) 2023-01-25 00:23:05 +01:00
Anonymous Maarten 6d11515873 cmake: make sdl3.pc relocatable 2023-01-15 12:37:51 -08:00
Anonymous Maarten 0a1479d58c cmake: fix sdl3.pc for Nintendo 3DS + add to test matrix 2023-01-15 17:46:36 +01:00
Anonymous Maarten b60084eb0b cmake: don't quote INOTIFY_INCLUDE_DIRS 2023-01-13 18:33:51 +01:00
Anonymous Maarten 1e8443f54e cmake: only use $<COMPILE_LANGUAGE:OBJC> when CMAKE_OBJC_COMPILER is defined 2023-01-12 21:12:54 +01:00
Anonymous Maarten 837416ef85 cmake: command-line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ 2023-01-10 02:39:09 +01:00
yuanhecai 50af65a7dd Fix loongarch64 support
HAS_LSX/LASX is modified as HAVE_LSX/LASX.
2023-01-09 09:11:50 +01:00
Anonymous Maarten 61f76efb85 cmake: do all compile tests with -D_GNU_SOURCE=1 2023-01-08 19:07:58 +01:00
Anonymous Maarten f53d797cca cmake: generate git hash using GetRevisionDescription CMake module
This allows the build system (ninja/make/VS) to detect whether the current
checkout git commit has changed. If so, SDL_revision.h will be updated.
2023-01-08 18:20:56 +01:00
Ozkan Sezer d4f7b0aa0e cmake: added missing INTERFACE to target_compile_definitions 2023-01-08 19:41:32 +03:00
Anonymous Maarten 77025417dd cmake: add SDL_ prefix to EXTRA_LIBS/EXTRA_LDFLAGS 2023-01-08 15:57:51 +01:00
Anonymous Maarten bffbfa572c cmake: rename SDL_STATIC_LIBS -> SDL_PC_STATIC_LIBS 2023-01-08 15:57:51 +01:00
Anonymous Maarten 2f1860cfc6 cmake: add sdl-shared-build-options target to collect SDL shared library flags 2023-01-08 15:57:51 +01:00
Anonymous Maarten 0003559adf cmake: handle macos current and compatibility version through VERSION/SOVERSION properties 2023-01-08 15:57:51 +01:00
Anonymous Maarten 053c37583c cmake: avoid modifying CMAKE_C_FLAGS 2023-01-08 15:57:51 +01:00
Anonymous Maarten 8fc445c730 cmake: SDL3 does not need -lmingw32 anymore because SDL_main has gone 2023-01-08 15:57:51 +01:00
Anonymous Maarten 562a8209d8 cmake: HAVE_LINUX_VERSION_H is unused 2023-01-08 15:57:51 +01:00
Anonymous Maarten 5555284a70 cmake: use target_compile_options to use -idirafter for khronos headers 2023-01-08 15:57:51 +01:00
Anonymous Maarten 4d9ee735fd cmake: SIZEOF_VOIDP, LIBNAME and LIBTYPE are not used 2023-01-08 15:57:51 +01:00
Anonymous Maarten 0a4420e02f cmake: rename cmake variables to include _PC_ as they are meant for pkgconfig file 2023-01-08 15:57:51 +01:00
Anonymous Maarten 373a6464c8 cmake: collect cflags in sdl-build-options and sdl-global-options 2023-01-08 15:57:51 +01:00
Anonymous Maarten fb80608fff cmake: use cmake <LANG>_VISIBILITY_PRESET property to pass -fvisibility=hidden 2023-01-08 15:57:51 +01:00
Anonymous Maarten 87af5cfc9f cmake: HAVE_GCC_PREFERRED_STACK_BOUNDARY is not used anymore 2023-01-08 15:57:51 +01:00
Anonymous Maarten d73b9fec1e cmake: target_compile_definitions does not need -D prefix 2023-01-08 15:57:51 +01:00
Ozkan Sezer ca541789ea cmake: check for math library functions even in the absence of libm
(Reference issue: https://github.com/libsdl-org/SDL/issues/7011)
2023-01-07 14:25:04 +03:00
Ozkan Sezer 5ea06f487d cmake: fix detection of library functions when -Werror is enabled.
(Reference issue: https://github.com/libsdl-org/SDL/issues/7011)
2023-01-07 14:25:04 +03:00
Ozkan Sezer 0f9b923ff4 cmake: fix detection of math library functions.
Fixes https://github.com/libsdl-org/SDL/issues/7011
2023-01-07 14:25:04 +03:00
Sam Lantinga 39852241ef Added -Wdocumentation to CMake clang build 2023-01-03 15:58:48 -08:00
Sam Lantinga 7f23d71b6a Added SDL_modf() and SDL_modff()
This function is useful for accumulating relative mouse motion if you want to only handle whole pixel movement.
e.g.
static float dx_frac, dy_frac;
float dx, dy;

/* Accumulate new motion with previous sub-pixel motion */
dx = event.motion.xrel + dx_frac;
dy = event.motion.yrel + dy_frac;

/* Split the integral and fractional motion, dx and dy will contain whole pixel deltas */
dx_frac = SDL_modff(dx, &dx);
dy_frac = SDL_modff(dy, &dy);
if (dx != 0.0f || dy != 0.0f) {
    ...
}
2022-12-29 23:12:19 -08:00
Anonymous Maarten 7150d6b05a cmake: add SDL3 to include path
This reverts parts of 9f2ca87
2022-12-29 09:01:56 -08:00
avafinger 12e0e6d130 SDL3 with Hardware Acceleration for ROCKCHIP platform (mali blob) 2022-12-26 08:50:51 -08:00
Ryan C. Gordon 1cf2b566af cpu: Removed 3DNow! support and SDL_Has3DNow().
Reference Issue #6636.
2022-12-23 09:30:56 -08:00
Anonymous Maarten 19d4d64cfe cmake: disable precompiled header for SDL_spinlock.c when targeting Android
This fixes the following error:
error: PCH file was compiled for the target 'thumbv7-none-linux-android16' but the current translation unit is being compiled for target 'armv7-none-linux-android16'
2022-12-21 09:39:22 -08:00
Anonymous Maarten 8f9227e4be cmake: use CMakePushCheckState to handle check states 2022-12-19 09:19:45 -08:00
Anonymous Maarten fab33545fa cmake: remove outdated fixme 2022-12-19 09:19:45 -08:00
Anonymous Maarten fe8291e09a cmake: only install SDL_test*.h headers when building SDL_test library 2022-12-19 09:19:45 -08:00
Anonymous Maarten 653893f188 cmake: declutter root + remove obsolete variables 2022-12-19 09:19:45 -08:00
Anonymous Maarten 289b024715 cmake: add function to print dict list 2022-12-19 09:19:45 -08:00
Anonymous Maarten a787b1c0b7 cmake: LINKER_LANGUAGE is a target property, not a cmake variable
LINKER_LANGUAGE needs to be used as following:
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>
  cmake [options] -S <path-to-source> -B <path-to-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

Haiku does not not this property explicitly set because CMake knows .cc files are c++
2022-12-19 09:19:45 -08:00
Anonymous Maarten 69812678cf cmake: cache cmake config installation folder in SDL_INSTALL_CMAKEDIR_ROOT
Make sure SDLx is not part of the cached variable such that it can be re-used by SDL2 and SDL3
2022-12-19 09:19:45 -08:00
Daniel Gibson c3bf253b09 Remove SDL3_main from build systems, remove most of src/main/*
XCode is still missing, and src/main/winrt/SDL3-WinRTResource*
still need to find a new home
2022-12-15 08:01:01 -08:00
Daniel Gibson 63d3fb469d Move src/main/haiku/ to src/core/
turns out that this wasn't even built as a static libSDLmain,
but as part of the (possibly dynamic) libSDL3
2022-12-15 08:01:01 -08:00
Daniel Gibson 989a8ca90e Port PSP SDL_main to header-only + SDL_RunApp() 2022-12-15 08:01:01 -08:00
Daniel Gibson b1b3bd654d Port PS2 SDL_main to header-only + SDL_RunApp() 2022-12-15 08:01:01 -08:00
Daniel Gibson 7bfc41db3c Unify all the SDL_*RunApp() functions into just SDL_RunApp()
makes the SDL_main code shorter

Also added a generic SDL_RunApp() implementation for platforms that
don't really need it.

Some platforms (that use SDL_main but haven't been ported yet) are
still missing, but are added in the following commits.
2022-12-15 08:01:01 -08:00
Daniel Gibson 1de559248e PortNintendo 3DS SDL_main to header-only + SDL_N3DSRunApp()
and move the #undef main and #define main SDL_main to the start/end of
SDL_main_impl.h instead of repeating it in every platform implementation

Thanks to SDL_N3DSRunApp we don't need the #include <3ds.h> in
SDL_main_impl.h - that caused conflicts with testthread.c, because both
have (different) ThreadFunc typedefs.
2022-12-15 08:01:01 -08:00
Daniel Gibson 2aee3e654d Remove SDL_main from VS Solutions in VisualC/ and VisualC-GDK/
and update README-visualc.md and README-gdk.md accordingly

Also moved src/main/windows/version.rc to src/core/windows/
and adjusted VS solutions, CMakeLists.txt and versioning scripts
in build-scripts/ accordingly.

This will eventually allow us to remove all of src/main/

# Conflicts:
#	VisualC/tests/testgesture/testgesture.vcxproj
2022-12-15 08:01:01 -08:00
Anonymous Maarten 9eb4d1f020 cmake: use FindALSA.cmake to find ALSA libraries
Co-authored-by: nfarid <54642193+nfarid@users.noreply.github.com>
2022-12-12 01:37:01 +01:00
Jan Engelhardt 1878674477 build: add symbol versioning for SDL
If a program built against one version of SDL is run in an
environment where there is an earlier version of the SDL .so library
installed, the result varies depending on platform configuration; in
the best case, it won't start at all, at worst it aborts in the
middle of the user doing "something important" (systems implementing
lazy symbol resolution). verdefs on the other hand are always checked
on startup.

The dependency information present in programs and shared libraries
is not only of value to the dynamic linker, but also to a
distribution's package management. If the dynamic linker is able to
tell that a program is not runnable per the above, a package manager
is able to come to the same conclusion — and block the installation
of a nonfunctional program+library ensemble.

Because there are a lot more symbols than there are libraries (I am
going to throw in "10^4 to 1 or worse"), package managers generally
do not evaluate symbols, but only e.g. the SONAME, NEEDED and VERNEED
fields/blocks. Because the SONAME is the same between two SDL
versions like 2.0.24, and 2.0.26, everything rests on having verdefs.

This patch proposes the addition of verdefs.
2022-12-02 13:05:37 -08:00
Sam Lantinga e2432bbd3b How did PS2 build without a condition variable implementation? 2022-12-02 12:37:41 -08:00
Anonymous Maarten 14ffaba399 cmake: build with rpath's, they are removed on install
This allows to build and run tests (on Linux) linked against the shared library
2022-12-01 20:32:47 +01:00
Sam Lantinga 1e2dfdb019 Removed the OpenGL ES 1.0 2D render implementation
In SDL3 we plan to make more use of shaders in the 2D render API, and this minimizes the number of platforms we have to consider for new features. OpenGL ES 2.0 or newer is supported on all modern iOS and Android devices.
2022-11-30 13:39:37 -08:00
Sam Lantinga c5790359fd
Added precompiled header support for Visual Studio and Xcode (#6710)
Fixes https://github.com/libsdl-org/SDL/issues/6704
2022-11-29 18:34:15 -08:00
Anonymous Maarten a52327f6b8 cmake: add support for precompiled headers 2022-11-29 14:23:42 -08:00
Sam Lantinga 71d5f510c6 Fixed dylib generation on macOS
We just build libSDL3.dylib instead of libSDL3.0.0.0.dylib with symlinks

Fixed the compatiblity vs current version, e.g.

SDL 3.20.87
    @rpath/libSDL3.0.dylib (compatibility version 2001.0.0, current version 2001.87.0)

SDL 3.21.5
    @rpath/libSDL3.dylib (compatibility version 2106.0.0, current version 2106.0.0)
2022-11-29 11:57:19 -08:00
Anonymous Maarten 6f20d990ad cmake: swap VERSION and SOVERSION 2022-11-29 20:36:46 +01:00
Anonymous Maarten ba19d3c048 cmake: remove SDL_CMAKE_DEBUG_POSTFIX option
Use CMAKE_DEBUG_POSTFIX instead
2022-11-29 11:29:03 -08:00
Anonymous Maarten 2d89c4680f cmake: simplify .so and .dylib versioning 2022-11-29 11:29:03 -08:00
Anonymous Maarten 7e7a8e76a5 cmake: move platform detection to cmake/sdl/paltform.cmake for re-use by SDL2-compat 2022-11-29 21:10:56 +03:00
Anonymous Maarten e2060de714 cmake: use target_link_libraries to pass -Wl,--undefined=WinMain 2022-11-29 21:10:56 +03:00
Sam Lantinga c2432f8d0d Rename SDLmain to SDL_main and SDLtest to SDL_test for consistency with other SDL libraries 2022-11-28 10:57:59 -08:00
Anonymous Maarten 3acd1ad25f cmake: only MSVC understands -nodefaultlib:MSVCRT 2022-11-28 00:20:22 +01:00
Anonymous Maarten 5151cbf4d1 cmake: check essential headers even when building with SDL_LIBC=OFF 2022-11-28 00:20:22 +01:00
Anonymous Maarten 9d7e4a7d6e cmake: don't cache HAVE_xxx variables for checking libc features 2022-11-28 00:20:22 +01:00
Anonymous Maarten b2e428626b cmake: disable system iconv by default on Windows
This is a different default then current CMake and autotools, but matches the released SDLx.dll's.
2022-11-28 00:20:22 +01:00
Anonymous Maarten 27707755c1 cmake: use SDL_LIBC_DEFAULT for default SDL_LIBC value 2022-11-28 00:20:22 +01:00
Anonymous Maarten 3fad16cc2b cmake: use SDL_CPU_X86 to enable MMX/SSE on x86 2022-11-28 00:20:01 +01:00
Anonymous Maarten 21f8e3ce04 cmake: use CMakePushCheckState while testing ARM NEON support 2022-11-28 00:20:01 +01:00
Anonymous Maarten 46d85fd5a4 cmake: don't cache HAVE_3DNOW value 2022-11-28 00:20:01 +01:00
Anonymous Maarten 82360b3175 cmake: don't cache HAVE_SSE value 2022-11-28 00:20:01 +01:00
Anonymous Maarten 375456a3a0 cmake: use SDL_ASSEMBLY_DEFAULT for default SDL_ASSEMBLY value 2022-11-28 00:20:01 +01:00
Anonymous Maarten 9f2ca87504 build: don't add SDL3 subfolder to include path for external projects 2022-11-27 14:33:13 -08:00
Sam Lantinga 2af4f74e1c Remove sdl3.m4 and sdl3-config, and document pkg-config as the recommended replacement
Fixes https://github.com/libsdl-org/SDL/issues/6639
2022-11-27 14:11:06 -08:00
Sam Lantinga 0a48abc860 Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>`
I ran this script in the include directory:
```sh
sed -i '' -e 's,#include "\(SDL.*\)",#include <SDL3/\1>,' *.h
```

I ran this script in the src directory:
```sh
for i in ../include/SDL3/SDL*.h
do hdr=$(basename $i)
   if [ x"$(echo $hdr | egrep 'SDL_main|SDL_name|SDL_test|SDL_syswm|SDL_opengl|SDL_egl|SDL_vulkan')" != x ]; then
        find . -type f -exec sed -i '' -e 's,#include "\('$hdr'\)",#include <SDL3/\1>,' {} \;
    else
        find . -type f -exec sed -i '' -e '/#include "'$hdr'"/d' {} \;
    fi
done
```

Fixes https://github.com/libsdl-org/SDL/issues/6575
2022-11-26 22:15:18 -08:00
Sam Lantinga e4b97c42b3 cmake: avoid copy of headers by moving generated headers to include/build_config (thanks @madebr!)
Shove all build system generated headers in include/build_config.
Doing this, cmake does not need to copy the headers anymore.
This was done for external projects vendoring SDL.

See https://github.com/libsdl-org/SDL/issues/6641#issuecomment-1328092535
2022-11-26 15:37:08 -08:00
Sam Lantinga bde808cd87 Fixed some warnings when building on Linux with -DSDL_LIBC=OFF 2022-11-26 05:18:26 -08:00
Sam Lantinga 63f307fe1f Remove SDL_config.h from the public headers
The SDL headers are no longer dependent on the build configuration.

Fixes https://github.com/libsdl-org/SDL/issues/6643 and https://github.com/libsdl-org/SDL/issues/6641
2022-11-26 04:48:36 -08:00
Sam Lantinga cc1f9eb983 Use Apple's nomenclature for macOS and iOS
Fixes https://github.com/libsdl-org/SDL/issues/6621
2022-11-25 16:00:06 -08:00
Anonymous Maarten 716821ca67 autotools: remove SDL3.spec.in 2022-11-25 15:37:30 -08:00
Anonymous Maarten 95b0712033 cmake: don't create libSDL3.so symbolic link at install time 2022-11-25 12:57:32 -08:00
Simon McVittie 7ef38beb7e build: Simplify library name
We want the library to come out as libSDL3.so.0 on Unix, or something
similar on other platforms. There's no need to have libSDL3-3.0.so.0,
because next time we intentionally break the API it should become libSDL4
anyway.

Partially implements #5626.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-25 12:57:32 -08:00
Anonymous Maarten 4574c16178 cmake: test for lsx and lasx intrinsics for loongarch 2022-11-25 21:50:08 +01:00
Anonymous Maarten d1f423d9db cmake: make all assembly options depend on SDL_ASSEMBLY and architecture 2022-11-25 21:50:08 +01:00
Anonymous Maarten d0e14008b5 cmake: find libudev library so it gets priority 2022-11-25 21:36:53 +01:00
Anonymous Maarten 1bbff6596c cmake: add support for some BSD's wscons input 2022-11-25 21:36:53 +01:00
Ozkan Sezer 1e4cd682b3 removed M_PI detection from cmake, removed HAVE_M_PI from config files.
(didn't touch autofoo side for it so as not to break PR/6605)
2022-11-25 22:35:40 +03:00
Anonymous Maarten ecd36c8f07 cmake: fix typo's in last commit 2022-11-25 04:31:25 +01:00
Anonymous Maarten c9b8559af5 cmake: use option to pass extra check options instead of hardcoding them 2022-11-25 03:15:30 +01:00
Anonymous Maarten c069ff1586 cmake: add /usr/local/include to check include directories 2022-11-24 23:33:59 +01:00
Anonymous Maarten cd13600944 cmake: don't reset check state after pushing state 2022-11-24 23:33:54 +01:00
Cameron Cawley 84781a7b6f
Disable the offscreen video driver if EGL is unavailable (#6234) 2022-11-23 10:55:34 -08:00
Sam Lantinga a635a485bc Re-added WinRT support until we're sure that it's no longer being used 2022-11-23 10:41:43 -08:00
Ozkan Sezer 34231f5ba0 reverted opengles removal. 2022-11-23 18:50:02 +03:00
Ozkan Sezer 5db60670ba removed linkage to OpenGLES framework 2022-11-23 07:47:00 +03:00
Ozkan Sezer 016b757311 reverted jack audio backend removal. 2022-11-23 06:50:20 +03:00
Ozkan Sezer dc2a3e06e9 removed WinRT support. 2022-11-22 23:36:24 +03:00
Ozkan Sezer 7df102d220 reverted sndio backend removal. 2022-11-22 22:04:10 +03:00
Ozkan Sezer 30b1ab2add removed opengles. 2022-11-22 21:48:40 +03:00
Ozkan Sezer 3aea865cdf removed directfb support. 2022-11-22 20:45:45 +03:00
Ozkan Sezer cdb54ad21e removed arts, esd, fusionsound, nas, paudio, sndio, sunaudio, winmm audio backends. 2022-11-22 19:51:56 +03:00
pionere 68b30d24e0 cmake: get rid of the duplicated _USE_MATH_DEFINES
- define _USE_MATH_DEFINES in SDL_stdinc.h only
- define _USE_MATH_DEFINES if not defined already
2022-11-22 08:31:35 -08:00
Ozkan Sezer 8d6fda4810 removed os2 support & support for building SDL with watcom. 2022-11-22 19:18:47 +03:00
Sam Lantinga 2c4159b99a First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
Sam Lantinga 0bfeed061b Updated to version 2.26.0 for release 2022-11-21 16:15:58 -08:00
Sam Lantinga 8ae46a49ea Save the version in VERSION.txt instead of VERSION
Fixes https://github.com/libsdl-org/SDL/issues/6558
2022-11-21 06:57:02 -08:00
Sam Lantinga 802c624ab3 Strip trailing newline when reading the VERSION file 2022-11-20 14:37:05 -08:00
Ozkan Sezer 3bc4bad8fb add missing strcasestr checks to cmake and autotools build systems,
and update config files.
2022-11-20 14:20:33 -08:00
Sam Lantinga 78ea6af2cd Updated to version 2.25.1 for release candidate 2022-11-17 09:01:35 -08:00
Anonymous Maarten 819b0143e3 cmake: enable SDL_TEST by default for emscripten 2022-11-16 15:42:08 +01:00
Anonymous Maarten 55384db8a6 cmake: emscripten has libunwind.h, libunwind.a has missing symbols 2022-11-16 15:42:08 +01:00
Anonymous Maarten 6e46090a30 cmake: check ALL headers inside the look (including sys/types.h) 2022-11-16 15:42:08 +01:00
Anonymous Maarten 500bac0b13 cmake: include FIndPkgConfig.cmake through find_package 2022-11-16 15:42:08 +01:00
Pierre Wendling a71ad40ac3
CMake: Add option to use Ccache. 2022-11-15 19:04:22 +01:00
Sam Lantinga 9f8b68a278 Fixed building without linux/input.h
https://github.com/libsdl-org/SDL/issues/6169
2022-11-11 10:25:52 -08:00
Anonymous Maarten 61297f703a cmake: on Apple, check for presence of an OBJC compiler 2022-11-03 15:03:47 +01:00
Luca Lolli b50e429354 Fix compilation for .m files extension 2022-11-03 15:03:47 +01:00
Anonymous Maarten 4c704ecfdd cmake: use SDL2-static as static library output name when prefix/static == ""/".lib"
Apparently, some clang@Windows compilers do this.
2022-11-01 13:53:09 -07:00
Anonymous Maarten c3b13346e0 On x86, pass -nodefaultlib to linker when wanting to avoid the C library 2022-10-22 09:28:00 -07:00
Simon McVittie 4ca5ea5b7e build: Add a mechanism to mark builds with vendor info
Downstream distributors can use this to mark a version with their
preferred version information, like a Linux distribution package version
or the Steam revision it was built to be bundled into, or just to mark
it with the vendor it was built by or the environment it's intended to
be used in.

For instance, in Debian I'd use this by configuring with:

    --enable-vendor-info="${DEB_VENDOR} ${DEB_VERSION}"

to get a SDL_REVISION like:

    release-2.24.1-0-ga1d1946dc (Debian 2.24.1+dfsg-2)

which gives a Debian user enough information to track down the patches
and build-time configuration that were used for package revision 2.

In Autotools and CMake, this is a configure-time option like any other,
and will go into both SDL_REVISION (via SDL_revision.h) and
SDL_GetRevision().

In other build systems (MSVC, Xcode, etc.), defining the
SDL_VENDOR_INFO macro will get it into the output of SDL_GetRevision(),
although not SDL_REVISION.

Resolves: https://github.com/libsdl-org/SDL/issues/6418
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-22 09:27:10 -07:00
Simon McVittie 2dc788cb9f build: Expand version info in SDL_REVISION and SDL_GetRevision()
Instead of using a URL and git sha1, this uses `git describe` to
describe the version relative to the nearest previous git tag, which
gives a better indication of whether this is a release, a prerelease,
a slightly patched prerelease, or a long way after the last release
during active development.

This serves two purposes: it makes those APIs more informative, and it
also puts this information into the binary in a form that is easy to
screen-scrape using strings(1). For instance, if the bundled version of
SDL in a game has this, we can see at a glance what version it is.

It's also shorter than using the web address of the origin git
repository and the full git commit sha1.

Also write the computed version into a file ./VERSION in `make dist`
tarballs, so that when we build from a tarball on a system that doesn't
have git available, we still get the version details.

For the Perforce code path in showrev.sh, output the version number
followed by the Perforce revision, in a format reminiscent of
`git describe` (with p instead of g to indicate Perforce).

For the code path with no VCS available at all, put a suffix on the
version number to indicate that this is just a guess (we can't know
whether this SDL version is actually a git snapshot or has been
patched locally or similar).

Resolves: https://github.com/libsdl-org/SDL/issues/6418
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-22 09:27:10 -07:00
Anonymous Maarten 5ed091c12d cmake: fix reporting of SDL_TESTS 2022-10-21 15:32:05 +02:00
Anonymous Maarten 96361fc476 cmake: create and install sdl2.pc for MSVC & WATCOM 2022-10-20 19:02:31 +02:00
Anonymous Maarten d542f43b2a cmake: add SDL_INSTALL_CMAKEDIR cache variable to override location of cmake config files 2022-10-19 16:41:25 +02:00
Wouter Wijsman 428b5ae546 PSP: Reorder extra imports 2022-10-18 10:34:51 +02:00
Pierre Wendling 392f3882d0 N3DS: Use SDL_Sensor instead of Joystick sensors. 2022-10-10 08:50:59 -07:00
Pierre Wendling 27557b62b6 N3DS: Prefix timer sources with `N3DS_`. 2022-10-10 08:50:59 -07:00