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.
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.
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
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.
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
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>
- 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
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.
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.
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.
- 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
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.
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)
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.
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.
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.
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.