Commit graph

193 commits

Author SHA1 Message Date
Jools Wills
65b77e23ab mali-fbdev support
* mali-fbdev support from https://github.com/mihailescu2m/libsdl2-2.0.2-dfsg1 with changes for newer SDL
2019-08-07 02:18:51 +01:00
Ryan C. Gordon
85acfec543 cmake: Add setupapi library to Windows build dependencies (hidapi needs it).
Fixes Bugzilla #4719.
2019-07-12 13:40:58 -04:00
Ryan C. Gordon
d94ce6c016 cmake: Added HIDAPI support.
--HG--
extra : rebase_source : 0b5f91722b2552f1f047e67a1f9c6a19be93c20d
2019-07-08 16:46:52 -04:00
Sam Lantinga
7623d36d47 Fixed bug 4684 - GLES1 variables missing under Android with CMake
Braden Obrzut

https://hg.libsdl.org/SDL/file/9d3f245739f8/CMakeLists.txt#l911

I believe the following should also be specified there:

set(SDL_VIDEO_OPENGL_ES 1)
set(SDL_VIDEO_RENDER_OGL_ES 1)

As it is now GLES1 support is missing when building for Android despite it linking to the library.
2019-06-21 22:01:27 -07:00
Sam Lantinga
a288bb0eca Updated version to 2.0.10 2019-06-17 10:13:28 -07:00
Sam Lantinga
badd09dfb5 Temporary fix for bug 4254 - a _lot_ of strict aliasing warnings
Ozkan Sezer

A horde of strict aliasing violation warnings are emitted from joystick
layer, and also from a few other places. This happens with gcc-4.4.7 on
Linux CentOS 6.10.  Some other sysjoystick would possibly have the same
warnings.

Attached my full log here. Example entry:
src/joystick/SDL_joystick.c: In function 'SDL_GetJoystickGUIDInfo':
src/joystick/SDL_joystick.c:1094: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules
2019-06-08 18:32:29 -07:00
Sam Lantinga
252adc0f0a Fixed bug 4593 - Respect CMake's BUILD_SHARED_LIBS default behavior
tschwinger

Respect the BUILD_SHARED_LIBS variable when defined, and build either shared or static libs, which is CMake's default behavior (See https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html).

If the variable is not defined, the current behavior remains unchanged and both variants are built where the platform supports it. This way, it remains possible to build both in one shot, which seems convenient for distro builds and useful to promote some consistency between them.
2019-06-08 14:36:03 -07:00
Sam Lantinga
f9cca459c8 Fixed bug 4594 - Fix install location of CMake targets on Apple platforms
tschwinger

Followup to #3651

As already noted by Ryan, no framework is being built, so we better install to lib/cmake.

That code was originally part of a patch submitted by David Demelier, whose credit BTW got lost (I combined his patch for #3572 with fixes for #2576 and #3613 resulting in #3651 because things started to depend on another).

I tested that the configuration files are found correctly in the new location on MacOS X based on a hint to the root (see https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure).
2019-06-08 14:34:38 -07:00
Sam Lantinga
0ece0e936d Fixed bug 4639 - CMake build does not generate libhidapi.so for Android
Manuel Sabogal

I noticed that the current Android.mk builds a libhidapi.so library for Android but the CMake build hasn't been updated to do so. I'll attach a patch that fixes this issue.
2019-05-21 17:33:31 -07:00
Serhii Charykov
f39fcaf980 Fix WORKING_DIR parameter 2018-12-03 20:14:35 +02:00
Sam Lantinga
0f77e6c119 Use _Exit() when available 2019-04-23 07:59:31 -07:00
Hugh McMaster
f386148e47 configure.in: Rename to configure.ac to fix an 'aclocal' warning
Also rename references in related files.
2019-03-25 23:01:32 +11:00
Ryan C. Gordon
26afcb485a events: Let arbitrary signals to simulate iOS/Android backgrounding events.
This lets you build a custom embedded device that roughly offers the "this
process is going to the background NOW" semantics of SDL on a mobile device.
2019-03-15 15:51:05 -04:00
Ryan C. Gordon
f77aac8e09 cmake: Comment out some debug logging that can upset build environments.
Something about the dashes, colons, numbers makes some builders believe this
is an error message.
2018-12-02 02:43:32 -05:00
Ryan C. Gordon
8a700e7a89 mir: Removed mir client support.
Fixes Bugzilla #4288.
2018-11-02 21:34:17 -04:00
Ozkan Sezer
ea9baa6056 CMakeLists.txt: set dylib version numbers properly. (bug #2915.) 2018-10-25 11:11:02 +03:00
Sam Lantinga
59f9488aa2 Mark a subsystem as dummy, not disabled, if it was intended to be compiled in.
From Tom Black:

I'm having problems initializing the sensor module. I'm compiling with a standard ./configure && make && sudo make install, and the module says it's enabled, but SDL_Init(SDL_INIT_EVERYTHING) is failing with SDL_GetError() returning "SDL not built with sensor support".
2018-09-28 21:19:27 -07:00
Sam Lantinga
567aeed888 commit 8f4dedc039190f5e734c47dcc4fc021b5793b659
Author: Michał Janiszewski <janisozaur+signed@gmail.com>
Date:   Fri Sep 28 20:38:04 2018 +0200

    CMake: fix building tests on Linux

    In case where libunwind.h has been found, it will be used by compiler,
    but linker wasn't updated to reflect use of this new library.
2018-09-28 21:03:39 -07:00
Ozkan Sezer
c85ef4d8f9 configury, cmake: add check for endpointvolume.h :
add HAVE_ENDPOINTVOLUME_H, HAVE_MMDEVICEAPI_H and HAVE_AUDIOCLIENT_H
in SDL_config.h.in, SDL_config.h.cmake, SDL_config_windows.h, and in
SDL_config_winrt.h.
2018-09-28 13:41:04 +03:00
Ozkan Sezer
91ed631b04 configury, cmake: make wasapi option independent of directx. 2018-09-28 11:30:50 +03:00
Sam Lantinga
f355625f9c Updated version to 2.0.9 2018-09-26 10:08:14 -07:00
Drew Pirrone-Brusse
bb213856aa Correct the name of the SDL shared library in CMake for Mac OS 2018-08-18 17:23:40 -04:00
Sam Lantinga
c4b6199246 Fixed bug 3166 - It would be nice, if SDL would support including SDL project as a subdirectory into another CMake project
Wayde Reitsma

After attempting to use SDL2 in the way described in this bug, I found the main issue was the includes not being added to the compiler command.

I found the issue was that the target_include_directories commands for the SDL2, SDL2-static and SDL2main targets only sets the public includes for installations using the INSTALL_INTERFACE generator expression.

I have written a patch to CMakeLists.txt that fixes this issue by adding another item to the target_include_directories commands, utilizing the BUILD_INTERFACE generator expression to correctly add the include directory during builds.
2018-09-24 08:41:59 -07:00
Ryan C. Gordon
a2a70b23b1 cmake: correctly report Vulkan support at configure time (thanks, Tiago!).
Fixes Bugzilla #4262.

--HG--
extra : amend_source : 7b1ebe533fe01925ace83d32db188c2f002fc9b1
2018-09-18 11:49:42 -04:00
Ozkan Sezer
65c879d930 CMakeLists.txt: fix typo SDL_SENSORS_DISABLED -> SDL_SENSOR_DISABLED 2018-09-02 23:57:06 +03:00
Ryan C. Gordon
71439d04cb cmake: add sensor subsystem to the build.
--HG--
extra : amend_source : 1bf21ac4f6adc8b9b631b6e45b46aef7640f3b9c
2018-08-23 14:32:30 -04:00
Sam Lantinga
09c276f295 First pass on the new SDL sensor API 2018-08-21 12:11:34 -07:00
Ethan Lee
54ce812205 SDL_exp 2018-08-04 11:52:46 -04:00
Ryan C. Gordon
b41191fbf2 cmake: use WINDOWS instead of WIN32.
--HG--
extra : histedit_source : be7d5850d1e2d3ca834da337a4ac88dca63c0547
2018-08-02 16:21:43 -04:00
Vitaly Novichkov
2b79c7662d Remove "lib" prefix from DLL file on MinGW builds
closes bug #4209.
2018-06-29 18:29:17 +03:00
Ozkan Sezer
45850bad77 make WASAPI configurable in autofoo and cmake (default is on.)
closes bug #3798.
2018-07-01 17:01:04 +03:00
Sam Lantinga
62c327d9a7 Fixed bug 4135 - Broken symlink libSDL2.so since rev11940
Tiago O.

Symlink points to the wrong folder, and target will always have debug postfix, so it'll be broken for other build types.
2018-04-15 09:37:51 -07:00
Bastien Bouclet
88acc282f7 Fix the include path in the installed CMake target import file
Previously the include path was {INSTALL_PREFIX}/include,
it is now {INSTALL_PREFIX}/include/SDL2 to be consistent with
the other build and package configuration systems.

Fixes #4128.
2018-04-11 06:16:23 +02:00
Saad Khattak
a3d99457b8 Added debug postfix to install command and fixed library path 2018-04-10 08:03:54 -07:00
Michał Janiszewski
00e572e04d Fix ARM builds with MSVC 2018-03-10 21:16:14 -08:00
Olli Kallioinen
5babbd2ae6 cmake: Set debug library name suffix per target instead of setting it globally. Don't add a suffix on android 2018-02-25 19:22:47 +02:00
Sam Lantinga
507975a360 Fixed bug 4092 - CMake support for building everything in the "test" directory
Eric Wasylishen

Patch to support building the tests with cmake.
Disabled by default, use: "cmake .. -DSDL_TEST=YES" to enable the tests.

Tested on macOS 10.13 with the ninja, makefile, and Xcode generators, and Windows 10 with the Visual Studio 2017 generator.
2018-02-24 08:59:58 -08:00
Ethan Lee
8551a596fa SDL_log10 2018-01-17 11:53:09 -05:00
Sam Lantinga
734feea49c Description: fix installation of shared library for Android
Author: Boris Pek <tehnick-8@yandex.ru>
Last-Update: 2018-01-10
2018-02-07 14:03:24 -08:00
Sam Lantinga
aef30f74b7 Check for immintrin.h before using it in SDL_cpuinfo.h 2017-12-11 12:00:12 -08:00
Ryan C. Gordon
1745441419 audio: Port WASAPI to WinRT, remove XAudio2 backend.
XAudio2 doesn't have capture support, so WASAPI was to replace it; the holdout
was WinRT, which still needed it as its primary audio target until the WASAPI
code code be made to work.

The support matrix now looks like:

WinXP: directsound by default, winmm as a fallback for buggy drivers.
Vista+: WASAPI (directsound and winmm as fallbacks for debugging).
WinRT: WASAPI

--HG--
extra : amend_source : a28a9a9fbb09c4c25df05fa0a754fce0bee62335
extra : histedit_source : e5727ceb1a5db5806ce02534d8ffe4892eb6f5d9
2017-12-06 12:24:32 -05:00
Sam Lantinga
34553b8de0 Fixed bug 3975 - Add GLES2 support for macOS via ANGLE library
Andrey

Seems latest google angle library successfully built & tested under macOS'es.

https://github.com/google/angle

We need to use GLES2 to implement true cross-platform code.
2017-12-04 20:35:01 -08:00
Sam Lantinga
2dd806061a Fixed bug 3959 - cmake build broken by commit 11702 (cf166abbde4a) due to typo
Mate Nagy
There is a typo in CMakeLists.txt that makes CMake exit with failure.

Change that causes the problem: (Notice the double ending brackets)
   ${SDL2_SOURCE_DIR}/src/video/*.c)
+  ${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c)

Fix:
Just remove the first ending bracket resulting in:
   ${SDL2_SOURCE_DIR}/src/video/*.c
   ${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c)
2017-11-20 00:03:23 -08:00
Sam Lantinga
145d2469ae Updated SDL's YUV support, many thanks to Adrien Descamps
New functions get and set the YUV colorspace conversion mode:
	SDL_SetYUVConversionMode()
	SDL_GetYUVConversionMode()
	SDL_GetYUVConversionModeForResolution()

SDL_ConvertPixels() converts between all supported RGB and YUV formats, with SSE acceleration for converting from planar YUV formats (YV12, NV12, etc) to common RGB/RGBA formats.

Added a new test program, testyuv, to verify correctness and speed of YUV conversion functionality.
2017-11-12 22:51:12 -08:00
Sam Lantinga
a429dc96f9 Updated version to 2.0.8 since SDL_image depends on it 2017-11-04 21:58:48 -07:00
Sam Lantinga
4e9aab5884 Added SDL_fmod() and SDL_fmodf() 2017-11-04 17:35:03 -07:00
Sam Lantinga
554d129015 Added float versions of SDL's math functions 2017-11-04 15:34:14 -07:00
Sam Lantinga
4418242860 Fixed bug 3882 - cmake fix for osx
Ozkan Sezer

In my cross-build environment with cmake-2.8.12.1, cmake does not add
SDL_coreaudio.m to its makefiles and the result is a failure. The fix
is simple: set the language to C for it as it is done at other places
in CMakeLists.txt.
2017-10-15 21:07:01 -07:00
Sam Lantinga
4d7a2db434 Added functions to query and set the SDL memory allocation functions:
SDL_GetMemoryFunctions()
    SDL_SetMemoryFunctions()
    SDL_GetNumAllocations()
2017-10-12 13:44:28 -07:00
Sam Lantinga
20693f4ac7 Fixed bug 3866 - CMake error when trying to make the 'uninstall' target when it already exists
Steve Robinson

In my project, the 'uninstall' target is already created by the glew library.  I get this error when SDL2 tries to create it:

CMake Error at _build/3rdparty/SDL2/SDL2-2.0.6/CMakeLists.txt:1816 (add_custom_target):
  add_custom_target cannot create target "uninstall" because another target
  with the same name already exists.  The existing target is a custom target
  created in source directory
  "D:/Code/sdl2-tutorial/_build/3rdparty/glew/glew-2.1.0/build/cmake".  See
  documentation for policy CMP0002 for more details.

To fix it, go to the bottom of the SDL2 CMakeLists.txt file.  Add an if statement to check for the existence of the target before creating it.  The end result looks like this:

if(NOT TARGET uninstall)
  configure_file(
      "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
      "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
      IMMEDIATE @ONLY)

  add_custom_target(uninstall
      COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()

This is how the glew library deals with this possibility in their CMakeLists.txt file.
2017-10-12 08:47:02 -07:00