Commit Graph

92 Commits

Author SHA1 Message Date
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