Commit Graph

269 Commits (bed6c5b81fea2ce87059237f2a292e0b970e4eb2)

Author SHA1 Message Date
Ozkan Sezer 0d8c22acd2 cmake (CheckPTHREAD): remove _GNU_SOURCE define after bug #7026 fix 2023-01-09 01:30:37 +03: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
Anonymous Maarten e85e11b211 cmake: avoid adding full path to SDL_EXTRA_LIBS
This avoids placing e.g. -l/path/to/libX11.so in sdl3.pc when configuring with -DSDL_X11_SHARED=OFF
2023-01-08 15:57:51 +01:00
Anonymous Maarten dfcd8d5835 cmake: remove unused function 'listtostrrev' 2023-01-08 15:57:51 +01: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 053c37583c cmake: avoid modifying CMAKE_C_FLAGS 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 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 7150d6b05a cmake: add SDL3 to include path
This reverts parts of 9f2ca87
2022-12-29 09:01:56 -08:00
Sylvain aa46ff8f4b Remove SDL_WINDOW_SHOW flag, as redundant with SDL_WINDOW_HIDDEN 2022-12-28 12:16:57 -08:00
Sylvain ab0c5cf07d
Fix compilation 2022-12-27 17:25:31 +01:00
avafinger 12e0e6d130 SDL3 with Hardware Acceleration for ROCKCHIP platform (mali blob) 2022-12-26 08:50:51 -08:00
Anonymous Maarten 8f9227e4be cmake: use CMakePushCheckState to handle check states 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 39a7abad7a cmake: lowercase all macros 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
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 22e22ba196 Add SDL_main.h includes to tests
.. including cmake/test/*.c, whatever that does

(this is needed now because SDL.h doesn't include SDL_main.h anymore)
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
Ozkan Sezer bb8adf74e0 cmake/sdlchecks.cmake: make it diff smaller against SDL2 2022-12-02 03:01:02 +03: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
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
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 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 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
Anonymous Maarten 4574c16178 cmake: test for lsx and lasx intrinsics for loongarch 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 cd13600944 cmake: don't reset check state after pushing state 2022-11-24 23:33:54 +01:00
Anonymous Maarten 622f64dff2 cmake: add X11 include dir to check dirs 2022-11-24 20:59:02 +01: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 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
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
Hubert Maier 5dc93451d2
JANITORIAL : Correct some more spelling mistakes (#6489) 2022-11-06 11:49:37 -08:00
Anonymous Maarten 61297f703a cmake: on Apple, check for presence of an OBJC compiler 2022-11-03 15:03:47 +01:00
Anonymous Maarten 04bcc910e9 cmake: don't do enable_language(OBJC)
When SDL is included as a subproject, the following error might appear:
```
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_OBJC_COMPILE_OBJECT
```

This is probably because the master project does not see certain OBJC related variables
2022-11-03 15:03:47 +01: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
Brad Smith f37db957f8 Use -lpthread on OpenBSD 2022-10-21 16:53:26 -07:00
Anonymous Maarten 0823b5973a cmake: fix finding wayland-libdecor
It was broken in 11d53c84a7
2022-10-21 15:31:43 +02:00
Anonymous Maarten 11d53c84a7 cmake: use pkg-config's library dirs as hint for finding a shared library 2022-10-20 19:01:28 +02:00
Brad Smith f4e3af15a1 Simplify OSS test by removing OpenBSD specific location of the soundcard.h header
OpenBSD has long since stopped using OSS. Remove checking for OpenBSD specific header.
2022-10-17 07:18:47 -07:00
Brad Smith 5ec1cef6b5 Further fixes for the sndio CMake detection 2022-10-07 11:55:00 +03:00
Brad Smith f48823181b Use the pkg-config file when checking for sndio. 2022-10-06 19:09:10 -07:00
Anonymous Maarten 81d3266766 cmake: make sure check_* uses 2 different variables in CheckX11 2022-09-27 03:47:20 +03:00
Anonymous Maarten a9524ffa9d cmake: make sure check_c_source_compiles uses 2 different variables in CheckOSS 2022-09-27 03:47:20 +03:00
Anonymous Maarten bfecd78159 cmake: use check_symbol_exists to check dlopen + need for dl library 2022-09-27 03:47:20 +03:00
Ozkan Sezer 098a7a043e add missing quotes to the fallback CHECK_OBJC_SOURCE_COMPILES macro
Closes:  https://github.com/libsdl-org/SDL/issues/6268 .
2022-09-21 10:37:02 +03:00
Anonymous Maarten 3b20e0ecef cmake: only add -Wl,--undefined=WinMain when building an executable 2022-09-19 05:00:24 +03:00
Anonymous Maarten 6dfd7a17e1 cmake: forward HAVE_LIBUSB to HAVE_HIDAPI_LIBUSB 2022-09-10 15:53:11 +02:00
Anonymous Maarten c3495ec6ea Fix value of SDL_HIDAPI_DISABLED 2022-09-10 14:11:19 +02:00
Anonymous Maarten 19b13aab98 cmake: mark hidapi as disabled when not found 2022-09-10 13:41:29 +02:00
Sam Lantinga 3f89d1704d Fixed building with libusb not dynamicaly loaded 2022-09-01 11:30:02 -07:00
Anonymous Maarten 17b329d199 cmake: enable disabing hidapi 2022-08-05 13:06:51 -07:00
Anonymous Maarten a4e6f3ca9d cmake: when there are alternatives, don't use libusb by default 2022-08-05 13:06:51 -07:00
Cameron Cawley 6e9a606a8e Add more mingw-w64 build workflows 2022-07-30 14:37:41 -07:00
Anonymous Maarten 430c39082f ci: test 'sdl2-config --static-libs' + 'pkg-config sdl2 --static' on ci 2022-07-26 14:24:36 -07:00
Anonymous Maarten e5698d1394 cmake: allow cmake re-configuration after installation of x11 library
check_include_path is not meant to be used to check for presence of a
library. This is because a BOOL is cached.
Avoid this caching by using find_file.
`find_file` caches a patch instead of a bool and will always run when
the result failed.
2022-07-21 18:38:12 +02:00
Anonymous Maarten 9ad3711a6b cmake: only enable x11_xss/x11_xrandr/x11_xfixes when its lib is available 2022-07-21 15:19:19 +02:00
Anonymous Maarten aa7a6c0ea6 cmake: only enable x11_xcursor and x11_xinput when its library is available 2022-07-21 14:38:57 +02:00
Anonymous Maarten fa39f73552
cmake: add generated files to a custom target (#5851)
This way, headers are only generated once .
2022-06-26 23:34:30 +02:00
Anonymous Maarten 6dcb2868b0 cmake: avoid use of possible non-available XEXT_LIB 2022-06-23 14:17:38 +02:00
Anonymous Maarten 78a3751659 cmake+ci: fix+test sdl2-config + sdl2.pc for all supported platforms 2022-06-23 14:17:38 +02:00
Anonymous Maarten b19099d557 cmake: use find_package(SampleRate) to find samplerate + allow targets 2022-06-16 16:47:19 -07:00
Anonymous Maarten 86f50ae7d7 ci: Test cmake build script on Android
android
2022-06-15 11:11:49 -07:00
Anonymous Maarten 18206446bf cmake: collect SDL_LIBS as list + export PKG_DIRECTFB_LDFLAGS 2022-06-15 11:11:49 -07:00
Anonymous Maarten 32df5aeb3d Check result of FindLibraryAndSONAME before use 2022-06-15 05:33:40 +03:00
Anonymous Maarten afc350eeff cmake: do 's#set(SOURCE_FILES #list(APPEND SOURCE_FILES #g' 2022-06-15 05:33:40 +03:00
Anonymous Maarten e99a7144ff Use list(APPEND EXTRA_LIBS) everywhere 2022-06-13 10:05:30 -07:00
Anonymous Maarten 5abd676917 Allow empty default values to the dep_option macro 2022-06-07 09:17:44 -07:00
Anonymous Maarten 9ff8f29f43 cmake: Add mini-SDL2 CMake project to test SDL2 prefixes 2022-06-03 12:41:36 -07:00
ShuangLiu1992 f4fc4719a5 fix CheckCOCOA on modern CMake
Modern CMake doesn't need "LANGUAGE C" for Objective-C
set_source_files_properties(${COCOA_SOURCES} PROPERTIES LANGUAGE C) should be removed fro video/cocoa/*.m as well otherwise project won't compile
see also d3cc5764c0
2022-05-21 09:53:50 -07:00
Ryan C. Gordon 7d7ec9c951
x11: Remove XVidMode and Xinerama support.
Fixes #1782.
2022-04-26 23:17:13 -04:00
Ethan Lee 13337e17a5 wayland: The rest of the wayland-client 1.18 requirement... Git, please 2022-03-23 13:27:01 -04:00
Joao Paulo Magalhaes 57df1dfce6 Video: do not use hardcoded VIVANTE and VDK libraries 2022-03-23 08:49:29 -07: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
Nick Cao f03215bc70 fix linking with SDL_PULSEAUDIO_SHARED=OFF and SDL_X11_SHARED=OFF 2022-03-07 12:55:50 +03:00
Luke Street 0cb39ed468 cmake: Fix SDL_LIBUSB_DYNAMIC soname 2022-02-07 14:22:31 -05:00
Ozkan Sezer 9403543671 cmake: enable_language(OBJC) only for APPLE 2022-02-05 18:50:00 +03:00
Ozkan Sezer 3c9ac4489e cmake: enable_language(OBJC) to fix check_objc_source_compiles(). 2022-02-05 18:45:50 +03:00
Ozkan Sezer 686a0f3456 cmake: include CheckOBJCSourceCompiles for cmake >= 3.16
c.f. bugs #5011 and #3912
2022-02-05 18:28:24 +03:00
Max Krummenacher c3a7cc34fb cmake: sdlchecks.cmake: pass cflags to the appropriate cmake variable
If egl.pc sets at least two macros as the i.MX Vivante driver does, e.g.:
| Cflags: -I${includedir} -DLINUX -DWL_EGL_PLATFORM

then we get the following error during configuration:

| -- Performing Test HAVE_OPENGL_EGL
| CMake Error: Parse error in command line argument: WL_EGL_PLATFORM
|  Should be: VAR:type=value

If one changes to add a value to the macro, e.g.
| Cflags: -I${includedir} -DLINUX=1 -DWL_EGL_PLATFORM=1
then cmake does not error out but the macro is not passed to the
C compiler.

CMAKE_REQUIRED_FLAGS is the wrong variable to pass the CFLAGS in,
CMAKE_REQUIRED_DEFINITIONS should be used.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2022-01-11 09:00:37 -08:00
Ozkan Sezer b265677610 cmake: initial attempt at adding os/2 support. 2022-01-11 11:33:02 +03:00
Ryan C. Gordon 7967c97618
cmake: Do a more thorough test for the old bcm Raspberry Pi libraries.
Fixes #5132.
2022-01-05 21:02:38 -05:00
Ozkan Sezer 398c0fdff0 cmake: simplify wayland-scanner 1.15 detection. 2021-12-18 23:56:10 +03:00
Wohlstand 54d2451069 sdlchecks.cmake: Small tune by @sezero 2021-12-18 20:32:20 +03:00
Wohlstand 6c9907dd0e Fixed build on CMake older than 3.7
I found this accidentally when I tried to use CMake 3.0 to build this.
2021-12-18 06:28:22 -08:00
Wohlstand 3861afacf5 Fixed build on CMake older than 3.13
Fixes #5096
2021-12-18 06:28:22 -08:00
Ozkan Sezer 03019c912a autotools, cmake: tighten Xfixes check && explicitly test BarrierEventID
Apparently the older versions of libXi doesn't have it.  Fixes the build
break issue reported at:
4b42c05ba1 (commitcomment-61427659)
2021-12-06 20:37:52 +03:00
Ozkan Sezer 5a0ea7fb17 Check for O_CLOEXEC definition in fcntl.h at configuration time,
If not available, define it internally as 0 (in SDL_internal.h).
Define it as available for macOS >= 10.7 in SDL_config_macosx.h.
2021-11-27 19:23:10 +03:00
Cameron Gutman 43d1b42a5a cmake: Sync build config options with autotools
- SDL_CLOCK_GETTIME now defaults to ON to match autotools build
- Add detection of float.h and Xdbe
- Fix detection of pthread_setname_np() (requires _GNU_SOURCE)
- Move SDL_USE_IME definition into SDL_config.h.cmake
2021-11-16 16:51:38 -08:00
Ozkan Sezer 7d3045f273 minor whitespace tidy-up. 2021-11-16 23:51:40 +03:00
Ozkan Sezer 68ffd24c58 autotools, cmake: don't define SDL_JOYSTICK_HIDAPI in CheckHIDAPI() 2021-11-16 23:37:20 +03:00
Sam Lantinga bbac1e9add Don't include pthreads code when threads are disabled
Fixes https://github.com/libsdl-org/SDL/issues/4950
2021-11-14 20:34:41 -08:00
Ozkan Sezer fa3330baec autotools, cmake: test Xfixes along with XInput2.h:
because we use Xfixes with XIBarrierReleasePointer
2021-11-12 12:55:50 +03:00
Sam Lantinga a0f8afb599 Separated the HIDAPI subsystem from HIDAPI joysticks
You can now disable HIDAPI joysticks while retaining the HIDAPI SDL API
2021-11-11 09:16:44 -08:00
Ethan Lee 4b42c05ba1 video: Add SDL_SetWindowMouseRect.
This API and implementation comes from the Unreal Engine branch of SDL, which
originally called this "SDL_ConfineCursor".

Some minor cleanup and changes for consistency with the rest of SDL_video, but
there are two major changes:

1. The coordinate system has been changed so that `rect` is _window_ relative
   and not _screen_ relative, making it easier to implement without having
   global access to the display.
2. The UE version unset all rects when passing `NULL` as a parameter for
   `window`, this has been removed as it was an unused feature anyhow.

Currently this is only implemented for X, but can be supported on Wayland and
Windows at minimum too.
2021-11-08 14:16:54 -08:00
Ozkan Sezer 1739ef3ee1 sdlchecks.cmake: remove libusb/hid.c and SDL_hidapi.c additions to srcs 2021-11-08 22:00:02 +03:00
Joel Winarske fdb27e0b08
cmake: Use host wayland-scanner only (#4873) 2021-10-25 12:04:07 -04:00
Ryan C. Gordon ab7910facf
cmake: Move the old, global add_definitions (etc) to an interface library.
Fixes #4150.
2021-10-05 12:34:29 -04:00
Ryan C. Gordon f1793af404
cmake: removed an add_definitions call. 2021-10-05 11:19:30 -04:00
Ryan C. Gordon 60d59aeb61
cmake: Calculate padding for dislaying options automatically. 2021-10-05 10:54:06 -04:00
Ryan C. Gordon 7850d0cf6f
cmake: Prefix all options with "SDL_"
This makes it clear which options came from SDL's CMake project when
building SDL as a subdirectory of a parent CMake project.

Fixes #4139.
2021-10-05 10:45:26 -04:00
Ethan Lee ef8c4d27d7 wayland: Require xkbcommon 0.5.0 or newer (2014-10-18)
Fixes #4645
2021-09-23 17:45:38 -04:00
Ryan C. Gordon 478f9eed28
x11: Don't include X11/extensions/extutil.h
We don't use it, it was a leftover from 1.2, I think, and it doesn't exist
on Solaris, so this should hopefully fix the build there.

This also means we don't need the configure/cmake checks for
SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY, so that was removed also.

Fixes #1666.
2021-09-20 10:22:50 -04:00
Ryan C. Gordon fff421f4b8
cmake: fix a bunch of things to properly link without LOADSO enabled.
The wrong logic, copy/pasted to a bunch of places, would correctly disable
the dynamic loading but fail to specify the libraries that SDL would now need
to explicitly link against.
2021-08-24 00:01:46 -04:00
Ozkan Sezer 77c8d11137 configuration updates for dlopen:
- cmake, configure (CheckDLOPEN): --enable-sdl-dlopen is now history..
  detach the dl api discovery from SDL_LOADSO_DLOPEN functionality.
  define HAVE_DLOPEN. also define DYNAPI_NEEDS_DLOPEN (CheckDLOPEN is
  called only for relevant platforms.)
- update SDL_config.in and SDL_config.cmake accordingly.
- SDL_dynapi.h: set SDL_DYNAMIC_API to 0 if DYNAPI_NEEDS_DLOPEN is
  defined, but HAVE_DLOPEN is not.
- pthread/SDL_systhread.c: conditionalize dl api use to HAVE_DLOPEN
- SDL_x11opengl.c, SDL_DirectFB_opengl.c, SDL_naclopengles.c: rely
  on HAVE_DLOPEN, not SDL_LOADSO_DLOPEN.
- SDL_config_android.h, SDL_config_iphoneos.h, SDL_config_macosx.h,
  SDL_config_pandora.h, and SDL_config_wiz.h: define HAVE_DLOPEN.

Closes: https://github.com/libsdl-org/SDL/pull/4351
2021-08-10 12:07:32 -07:00
Ozkan Sezer 5b18ae29b7 improvements to libdecor support in cmake
this makes it consistent with wayland support, and makes cmake side
in line with autotools' libdecor support.
2021-08-03 14:01:02 +03:00
Ozkan Sezer a15ec36547 attempt to fix cmake builds with libdecor 2021-08-03 11:33:50 +03:00
Ryan C. Gordon 74aa4b635c
cmake: don't fail if Wayland is enabled but libdecor isn't found.
Instead, just disable libdecor support.

This matches what the configure script does.
2021-08-03 03:10:14 -04:00
Christian Rauch 9e6fcbe72c wayland: client-side decoration 2021-07-25 14:54:12 -07:00
Nicolas Caramelli 6a2af48ad7 CMake: Generic check for desktop GL and EGL on Linux systems 2021-06-01 16:50:28 -07:00
Ozkan Sezer 89a2980a6d CMake: fixes to pthreads detection.
changes unnecessary check_c_source_runs to check_c_source_compiles,
removes the reduntant cross-compile check, and defines _GNU_SOURCE
for PTHREAD_MUTEX_RECURSIVE checks just like the autotools version.

Fixes: https://github.com/libsdl-org/SDL/issues/4262
Closes:  https://github.com/libsdl-org/SDL/pull/4282
2021-04-25 01:28:03 +03:00
Ryan C. Gordon a81fe27271
configure/cmake: Hook up Emscripten threads (disabled by default).
Fixes #3795.
2021-04-04 00:16:30 -04:00
vanfanel e213f37a45 [KMSDRM] Enable full OpenGL detection (MESA/libglvnd) on both the make and cmake buildsystems. 2021-03-15 18:47:22 -07:00
Cacodemon345 3853531f6d Fix CMake script on Linux 2021-03-15 10:11:01 +03:00
Cacodemon345 34de3b57a1 Fix CMake script on FreeBSD 2021-03-13 18:40:27 -08:00
Ivan Epifanov 47c105161b Add reversive list join macro 2021-03-08 09:07:12 -08:00
Frank Praznik 2f0b99a774 audio: Add Pipewire playback/capture sink 2021-02-28 19:40:09 -08:00
Ozkan Sezer 091a4649e8 added --enable-xinput switch for windows builds 2021-02-10 10:22:18 -05:00
Ozkan Sezer 2376458841 renamed SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H to SDL_HAVE_MACHINE_JOYSTICK_H 2021-01-24 00:51:25 -05:00
Sam Lantinga 351abc585b Fixed bug 5463 - generated Wayland interfaces are included in the library's ABI
Simon McVittie

In versions since 1.15, the `code` mode is a deprecated alias for
`public-code`, which emits symbols with default visibility, overriding
SDL's -fvisibility=hidden option.

Use the `private-code` mode instead. This emits symbols with hidden
visibility, so they do not affect the ABI of libSDL.

See also: https://bugreports.qt.io/browse/QTBUG-73099,
https://lists.freedesktop.org/archives/wayland-devel/2018-February/037097.html
2021-01-14 14:50:15 -08:00
Manuel Alfayate Corchete b24494734b [KMS/DRM] Go back to the LEGACY interface only because using planes breaks compatibility with HW, so no advantage on using ATOMIC. 2021-01-08 18:57:12 +01:00
Manuel Alfayate Corchete 13244de5c2 [Buildsystem] Only build KMSDRM support if EGL+OpenGL is detected by CMake. 2020-12-22 17:17:30 +01:00
Sam Lantinga ee180efda7 Fixed bug 5406 - Upstreaming DragonFlyBSD changes from DeltaPorts (patch from David Carlier) 2020-12-20 12:08:49 -08:00
Sam Lantinga f8839289b0 Potential fix for bug 5393 - KMSDRM: using atomic mode setting breaks GPU compatibility
Substring

I was trying the KMSDRM video backend with some very simple programs that were working ok on 2.0.12. The same code won?t work on the current dev branch and I get:

DEBUG: check_modesetting: probing ?/dev/dri/card0?
DEBUG: /dev/dri/card0 connector, encoder and CRTC counts are: 4 5 6
DEBUG: check_modesetting: probing ?/dev/dri/card0?
DEBUG: /dev/dri/card0 connector, encoder and CRTC counts are: 4 5 6
DEBUG: KMSDRM_VideoInit()
DEBUG: Opening device /dev/dri/card0
DEBUG: Opened DRM FD (3)
DEBUG: no atomic modesetting support.
DEBUG: Video subsystem has not been initialized
INFO: Using SDL video driver: (null)
DEBUG: Video subsystem has not been initialized

After carefully checking, the radeon driver doesn?t support atomic modesetting. That?s not the only problem : the same happens with the amdgpu driver if we disable Display Core (kernel parameter amdgpu.dc=0, which is required to get analogue outputs working).

This is a major regression in the KMSDRM driver.

Using atomic mode setting is great, but having no fallback to the "standard KMS" is bad.
2020-12-15 12:22:48 -08:00
Sam Lantinga bd032c1f72 Fixed bug 5221 - libusb isn't detected correctly in CMake
Sven-Hendrik Haase

In CMake I currently have trouble activating hidapi support as libusb-1.0 isn't ever correctly detected as it's searched for by the wrong name.

configure.ac correctly does this:

PKG_CHECK_MODULES([LIBUSB], [libusb-1.0], have_libusb=yes, have_libusb=no)

However, sdlchecks.cmake does this:

pkg_check_modules(LIBUSB libusb)

but it needs to be:

pkg_check_modules(LIBUSB libusb-1.0)
2020-12-09 07:26:59 -08:00
Ryan C. Gordon 2b7ce8c51d cmake: Set HAVE_VIDEO_WAYLAND_QT_TOUCH if appropriate (thanks, Michael!). 2020-04-14 18:14:39 -04:00
Ryan C. Gordon 952bac7c47 cmake: use check_symbol_exists, not check_function_exists (thanks, Manuel!)
This fixes the problem where we think iOS has fseeko64, etc, but doesn't.

Fixes Bugzilla #4885.
2020-04-13 15:22:09 -04:00
Ryan C. Gordon 377f2d35d5 configure: Remove wayland-protocols check from configure and CMake scripts.
We ship these with SDL now, don't need the system versions installed.
2020-04-01 13:43:53 -04:00
Sam Lantinga f7c9502dfb Fixed bug 5044 - CMake messes up hidapi path when project directory contains spaces
Eric Jing

When the project directory path contains spaces, CMake butchers the include path for the hidapi files.

I traced the problem to the cmake/sdlchecks.cmake file at line 1091, which sets flags for the build process. I surrounded the problem flag with double quotes, shown below, and CMake works with spaces in the project directory path.
2020-03-20 12:13:26 -07:00
Sam Lantinga c7a739bef4 Fixed bug 4643 - Append EGL CFLAGS in CheckOpenGLESX11
Danilo Spinella

EGL need -DMESA_EGL_NO_X11_HEADERS in systems without X11 installed. Make CMake checks import EGL CFLAGS.

Relevant bug: https://bugzilla.libsdl.org/show_bug.cgi?id=4243
2020-03-02 15:24:10 -08:00
Ethan Lee f7d82e5616 hidapi: Add SDL_hidapi.c, allows support for multiple hidapi backends.
This is currently supported on Linux and macOS. iOS and Android are not
supported at all, Windows support could be added with some changes to the libusb
backend. The Visual Studio and Xcode projects do not use this feature.

Based on Valve Software's hid.cpp, written in collaboration with Andrew Eikum.
2019-07-31 12:20:55 -04:00
Andrew Eikum e149f4c4b0 cmake: Fix locating libusb header at configure-time
Removing the CheckUSBHID call is necessary to avoid caching the failed header
check result before we find libusb via pkg-config.
2019-07-31 11:34:00 -05:00
Ryan C. Gordon 66d4d8e25d cmake: Added HIDAPI support. 2019-07-08 16:46:52 -04:00
Ryan C. Gordon bc57ac27f9 mir: Removed mir client support.
Fixes Bugzilla #4288.
2018-11-02 21:34:17 -04:00
Ryan C. Gordon 4f5bd53e8f wayland: Keep protocol XML files in-tree.
Now you don't need the latest Wayland installed to build with
newer protocols supported, as they'll build correctly; even if
your system can't use them, we can make intelligent decisions
at runtime about what's available on the current machine anyhow.

This also simplifies some logic and possible failure cases in
the configure and CMake scripts.

Fixes Bugzilla #4207.
2018-06-25 09:37:25 -07:00
Ryan C. Gordon c70db0cabf cmake: Look in popular places for X11 headers, export this info properly.
Fixes CMake not being able to find X11 on FreeBSD (which generally has the
headers in /usr/local/include/X11).

List of other popular places borrowed from CMake's FindX11 module.

This worked on the configure script because of magic in the AC_PATH_X macro.

Fixes Bugzilla #4815.
2018-06-24 15:12:18 -04:00
Sam Lantinga ba9ede12fb Fixed bug 4027 - CheckLibSampleRate macro in sdlchecks.cmake never defines HAVE_LIBSAMPLERATE{,_SHARED}, so they're always reported as disabled by MESSAGE_TESTED_OPTION macro in macros.cmake 2018-02-13 13:25:59 -08:00
Sam Lantinga 4ff16ba3a4 Fixed bug 4081 - sdlchecks.cmake: typo introduced by rev11848 breaks building with wayland support 2018-02-13 07:59:45 -08:00