Commit Graph

130 Commits

Author SHA1 Message Date
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
Guillermo A. Amaral bd0def06ee Set rpath instead of changing environment for RPi
Credit goes to Adrian Perez de Castro for the improvement.

Signed-off-by: Guillermo A. Amaral <g@maral.me>
2018-02-07 14:12:26 -08:00
Ryan C. Gordon cd53220749 wayland: Add support for xdg-shell protocol (unstable v6).
This is meant to be the desktop-enhanced version of wl_shell. Right now we
just match what the existing wl_shell code does, but there are other areas of
functionality available to us now, that we can fill in later.

This uses the "unstable" API, since this is what ships in Ubuntu 17.10 (as
part of Wayland 1.10), but Wayland 1.12 promotes this to stable with extremely
minor changes. We will add support for the stable version when it makes sense
to do so.
2018-02-07 13:13:55 -05:00
Ryan C. Gordon 32d421d490 cmake: Minor cleanup (reuse a string we already calculated). 2018-02-07 13:07:59 -05:00
Guillermo A. Amaral 35554caf16 Make rpi video cross-compiler friendly.
* Stops using fixed path to find GLES/EGL libs.
* Tries pkg-config to locate bcm_host.

Signed-off-by: Guillermo A. Amaral <g@maral.me>
2018-01-17 13:17:10 -08:00
Ryan C. Gordon c722e58d1f vulkan: Include a copy of vulkan.h and vk_platform.h.
Now we can provide Vulkan support in the build even if the build box doesn't
have a Vulkan SDK, since we dynamically link to the library anyhow.
2017-08-27 23:25:12 -04:00
Ryan C. Gordon 25e3a1ec90 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.
2017-08-27 22:15:57 -04:00
Ryan C. Gordon 80c6c2fa76 cmake: whoops, Sam and I both fixed this bug at the same time. :) 2017-08-09 22:34:45 -04:00
Sam Lantinga d3af447ee5 Fixed bug 3590 - CMAKE: typos in CheckMir
Martin Gerhardy

-            list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CLFAGS} ${XKB_CLFLAGS})
+            list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CFLAGS} ${XKB_CFLAGS})

CFLAGS is spelled wrong in two different ways for EGL and XKB

And while you are on it...

sdl needs mir >= 0.24 afaik - it fails on travis-ci (ubuntu 14.04 LTS with 0.18 installed and in other environments, too (e.g. https://github.com/urho3d/Urho3D/issues/1685)

To fix this one should add a min version check to pkg_check_modules like this

-        pkg_check_modules(MIR_TOOLKIT mirclient mircommon)
+        pkg_check_modules(MIR_TOOLKIT mirclient>=0.24 mircommon)
2017-08-09 18:47:33 -07:00
Ryan C. Gordon 1b8117be21 cmake: Don't link directly against a libpthread on Android (thanks, Anthony!).
Android has pthreads, but it's just part of their C runtime instead of a
separate library like the usual Linux platforms.

Fixes Bugzilla #3675.
2017-08-09 19:50:18 -04:00
Olli Kallioinen 2b5a5c510b Android build fixes
-Enabling checking for GCC_ATOMICS also on clang by default. This way all Android ABIs build successfully
 -Android cmake: Threading was not enabled correctly
 -Android cmake: Timers and dynamic lib loading were not included in the sources
2017-06-08 22:07:55 +03:00
Sam Lantinga 56363ebf61 Fixed bug 3690 - SDL2 KMS/DRM render context support
Manuel

The attached patch adds support for KMS/DRM context graphics.

It builds with no problem on X86_64 GNU/Linux systems, provided the needed libraries are present, and on ARM GNU/Linux systems that have KMS/DRM support and a GLES2 implementation.
Tested on Raspberry Pi: KMS/DRM is what the Raspberry Pi will use as default in the near future, once the propietary DispmanX API by Broadcom is overtaken by open graphics stack, it's possible to boot current Raspbian system in KMS mode by adding "dtoverlay=vc4-kms-v3d" to config.txt on Raspbian's boot partition.
X86 systems use KMS right away in every current GNU/Linux system.

Simple build instructions:

$./autogen.sh
$./configure --enable-video-kmsdrm
$make
2017-08-02 10:22:48 -07:00
Sam Lantinga 34b29c6ac5 Fixed bug 3688 - cmake / pthread check related patch proposal
Juha Niemim?ki

Fix for PTHREAD_MUTEX_RECURSIVE_NP check and restoring the original flags

Two fixes proposed:

1) Looks like there is a copy-paste issue regarding PTHREAD_MUTEX_RECURSIVE_NP check.

2) Compiler flag restoration doesn't look symmetrical regarding if/endif blocks. Moved to an outer block (if PTHREADS).
2017-07-10 18:40:35 -07:00
Ryan C. Gordon d9039f2396 jack: Initial shot at a JACK audio target.
http://jackaudio.org/

Fixes Bugzilla #2163.
(with several more commits following to improve this code.)
2017-06-08 13:27:58 -04:00
Sam Lantinga df25258a1e Added configure and cmake support for libsamplerate 2017-01-06 20:43:53 -08:00
Ryan C. Gordon 8a0704d15f cmake: Now generates Wayland protocol source bits like the configure script.
Fixes Bugzilla #3430.
2016-10-11 16:36:40 -04:00
Sam Lantinga abefe78507 Fixed bug 3043 - fix alsa configury and cmake checks
Ozkan Sezer

SDL's alsa uses snd_pcm_recover() which has been available only since alsa-lib-1.0.11.
2016-10-07 18:03:08 -07:00
Jukka Jyl?nki 264e996e0f Fix CMake CMAKE_REQUIRED_FLAGS handling to preserve existing CMake flags required by Emscripten toolchain. 2016-09-13 00:03:50 -07:00
Ryan C. Gordon 9fcf5d7d4d CMake: Don't link directly to libGL on Unix.
(we always dynamically load it at runtime when appropriate.)
2016-01-03 21:48:17 -05:00
Philipp Wiesemann 0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00