Commit Graph

583 Commits

Author SHA1 Message Date
Anonymous Maarten 354a35c1d7 cmake: port back Apple changes from SDL3 2024-08-14 10:35:43 +00:00
Anonymous Maarten 7cf3234efe cmake: SDL2 target is not always available 2024-08-04 15:52:16 +02:00
Anonymous Maarten 50a6a39dd6 cmake: use genexes for linking against apple frameworks 2024-07-27 17:13:52 +02:00
Anonymous Maarten ab4370c247 cmake: detect ARM64EC and enable SDL_LIBC by default 2024-07-19 10:20:11 +00:00
Anonymous Maarten 7fb8b62a4d cmake: fix building UWP with non-MSVC generator 2024-07-19 10:20:11 +00:00
Anonymous Maarten bc39952b23 cmake: only add SDL_LIBC=0 compile options to SDL2 libraries 2024-07-12 23:09:56 +02:00
Anonymous Maarten bba51871a8 cmake: only link SDL2 against test executables 2024-07-12 18:47:18 +02:00
Anonymous Maarten 8ae7841d91 Revert "Make sdl2-config interpreter configurable"
This reverts commit b9f005505b.

Making the interpreter configurable is a band-aid fix.
So revert the workaround until we know the actual cause.
2024-06-25 00:44:55 +02:00
Anonymous Maarten b9f005505b Make sdl2-config interpreter configurable 2024-06-23 23:30:50 +02:00
Ganael Laplanche ab5740bde2 Fix joystick (/dev/input/xxx) support on FreeBSD
Backport f8ad4abe from main branch.

When switching to CMake, src/joystick/linux/SDL_sysjoystick.c file got
excluded from FreeBSD builds, losing support for /dev/input/xxx devices.

See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279907
and: https://github.com/libsdl-org/SDL/pull/10087
2024-06-23 00:06:55 -07:00
Wouter Wijsman 1803e6555f CMake: Prevent double SDL2 and SDL2main entries in sdl2.pc 2024-06-03 10:53:45 +02:00
Cameron Cawley 65d8c07c7d Allow building the Raspberry Pi video driver with standard EGL headers 2024-05-27 12:30:58 -07:00
Anonymous Maarten 6c10201e58 cmake: direct3d12 renderer needs d3d12.h and d3d12sdklayers.h
Older MinGW releases don't ship d3d12sdklayers.h

backport of 3af4f120d0
2024-05-27 02:34:26 +02:00
Anonymous Maarten c79e616806 d3d12: older Windows SDK headers contain wrong function prototypes
Declare correct function pointers ourselves.

Backport of:
- 98fcf112e7
- 89a4d9ae67
2024-05-25 00:41:47 +02:00
Ozkan Sezer d8fbeec096 autotools, cmake, macOS: Do not use the system iconv() by default
backport from PR #9676 by @flibitijibibo
2024-05-03 11:56:50 +03:00
yuanhecai 75340b827d loongarch: Delete the configuration of the compilation option "mlasx" 2024-04-25 20:33:12 -07:00
Frank Praznik d3c89bb479 wayland: Allocate the cursor shared memory buffer entirely in memory, if possible.
Use memfd_create() to allocate the temporary SHM backing file in memory, and set the size with posix_fallocate(), which will return an error on insufficient space vs ftruncate(), which will silently succeed and allow a SIGBUS error to occur if the unbacked memory is accessed.

Additionally, make the legacy path more robust by unlinking the temp file, so it won't persist after close, and unmapping the shared memory buffer.

(cherry picked from commit 9bdb992925)
2024-03-12 20:56:16 -04:00
Anonymous Maarten 3184936950 cmake: we only need a C++ compiler for Android, Haiku and UWP 2024-03-11 01:26:13 +01:00
Sam Lantinga 8eed915dfa Don't use the system iconv on Apple mobile platforms
Fixes https://github.com/libsdl-org/SDL/issues/8964

(cherry picked from commit d6a48e4958)
2024-02-01 15:55:00 -08:00
Sam Lantinga 4845027cad Updated to version 2.31.0 for development 2024-01-22 09:12:34 -08:00
Sam Lantinga ef7261bc41 Updated to version 2.29.2 for RC build 2024-01-22 08:43:05 -08:00
yuanhecai ed5d3d9f82 Fix compilation on loongarch 2024-01-21 19:27:59 -08:00
Sam Lantinga b4f99deb9e Updated to version 2.29.1 for RC build 2024-01-19 19:58:24 -08:00
Julian Uy 884c21c565 Use common generic syscond for platforms with no cond implementation 2023-12-24 06:35:59 -08:00
Ozkan Sezer bbcf40e811 cmake: fixed iconv detection test program
Fixes https://github.com/libsdl-org/SDL/issues/8614
2023-11-26 01:55:24 +03:00
Ozkan Sezer 8cf7e9e7da autotools, cmake: set SDL_SYSTEM_ICONV to OFF for windows (like SDL3.) 2023-11-23 03:32:04 +03:00
Ozkan Sezer 17e62abb6d revise iconv detection:
- check libiconv with a linkage test with iconv.h included
- check libc iconv with a linkage test with iconv.h included
  and LIBICONV_PLUG defined (in case libiconv header is in
  include path)
- add new configuration option to prefer iconv from libiconv,
  if available, over the libc version, defaults to disabled:
  SDL_LIBICONV for cmake, --enable-libiconv for autotools.
- change FreeBSD specific LIBICONV_PLUG define in SDL_iconv.c
  to configuration result.
2023-11-22 23:29:00 +03:00
Ozkan Sezer 3fb5124174 cmake: add openbsd wscons sources to build, if supported 2023-11-22 05:10:02 +03:00
Anonymous Maarten d81d986858
cmake: fix uses of undefined macro identifiers (-Wundef) 2023-11-17 03:06:26 +00:00
Anonymous Maarten adc0880520 cmake: also install pdb files of static libraries 2023-11-09 03:23:24 +01:00
Sam Lantinga e8f4045d0b Use XINPUT_STATE instead of XINPUT_STATE_EX (thanks Andrew!)
XINPUT_STATE_EX isn't actually a thing, we can just use the normal XINPUT_STATE

Fixes https://github.com/libsdl-org/SDL/issues/2797
2023-11-04 22:24:55 -07:00
Anonymous Maarten 8b1b6734f6 cmake: fold HAVE_INPUT_EVENTS into HAVE_LINUX_INPUT_H 2023-11-02 21:28:39 +01:00
Anonymous Maarten 517db6d887 cmake: reset check state before testing -fobjc-arc 2023-10-30 21:08:30 +01:00
Anonymous Maarten 20630b2e6c cmake: check -fobjc-arc compiler flag on Apple platforms 2023-10-30 19:56:46 +01:00
Anonymous Maarten 7774de0fe3 cmake: file(RELATIVE_PATH) needs 2 absolute paths 2023-10-30 19:45:49 +01:00
Anonymous Maarten 90255914a8 cmake: install pdb's when present 2023-10-22 18:53:34 +02:00
Anonymous Maarten 933ec9e978 cmake: add qnx support
Co-authored-by: elahav <elahav@users.noreply.github.com>
2023-09-30 16:48:51 +02:00
Anonymous Maarten b388f6e32d cmake: use MSVC_RUNTIME_LIBRARY to force MT 2023-09-09 19:16:31 +02:00
Anonymous Maarten fcae9cd210 cmake: build with -Wdocumentation 2023-08-09 02:53:48 +02:00
Christopher Wellons 8231278817
Unaligned stacks on i686-w64-mingw32, may lead to crashes (#7607)
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-07-10 03:05:32 +03:00
Joshua Barnett 547c8c288b Add kernel32 to SDL_EXTRA_LIBS required for cross-compilation to Win32 native
Linking error experienced while compiling with the following toolchain
due to lack of kernel32.lib

d35e5f8dde/cmake/platforms/WinMsvc.cmake (L317-L321)
2023-07-09 14:02:32 +02:00
Anonymous Maarten 0262f757e1 cmake: check whether libunwind can be compiled and linked against 2023-07-05 00:25:24 +02:00
Anonymous Maarten 8908d16285 cmake: explicitly disable WINDOWS_EXPORT_ALL_SYMBOLS for SDL2
This fixes the following errors when a dll attempts to link to a shared SDL2::SDL2:

m.c.obj : error LNK2019: unresolved external symbol __imp___acrt_iob_func referenced in function printf
m.c.obj : error LNK2019: unresolved external symbol __imp___stdio_common_vfprintf referenced in function _vfprintf_l
MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReport referenced in function _CRT_RTC_INIT
MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function _CRT_RTC_INITW
MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcpy_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcat_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf_s referenced in function _vsprintf_s_l
MSVCRTD.lib(error.obj) : error LNK2001: unresolved external symbol __C_specific_handler_noexcept
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
2023-07-05 00:15:46 +02:00
scribam e42a3a3233 cmake: use SDL_CPU_ARM32 instead of CMAKE_GENERATOR_PLATFORM STREQUAL "ARM" 2023-07-01 23:26:19 +02:00
Sam Lantinga ceece918e4 Updated to version 2.29.0 for development 2023-06-20 11:50:19 -07:00
Sam Lantinga ffa78e6bea Updated to version 2.28.0 for release 2023-06-20 11:00:20 -07:00
Sam Lantinga d4f9be4416 Updated to version 2.27.1 for release candidate 2023-06-13 19:44:26 -07:00
Anonymous Maarten 14f4fd3f11 git commit -m "cmake: set maximum policy to 3.5
This fixes the following warning when configuring with CMake 3.27+:
```
CMake Deprecation Warning at CMakeLists.txt:3190 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
```
2023-06-07 20:35:32 +02:00
Anonymous Maarten 72606d97e6 cmake: allow #include "SDL2/SDL.h.h" when using SDL2 as subproject 2023-05-27 01:48:30 +02:00
Sam Lantinga 63b8af3558 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

Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-05-24 04:45:40 +03:00