Commit Graph

129 Commits

Author SHA1 Message Date
David Ludwig ec65a34b8e CMake: tvOS support/fixes
To use, set the following CMake variables when running CMake's configuration stage:
- CMAKE_SYSTEM_NAME=tvOS
- CMAKE_OSX_SYSROOT=<SDK>  (examples: appletvos, appletvsimulator, appletvos12.4, /full/path/to/AppleTVOS.sdk, etc.)
- CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures> (example: "arm64;x86_64")
2019-08-27 12:30:20 -04:00
David Ludwig b13c951cca CMake: iOS support added
When using a recent version of CMake (3.14+), this should make it possible to:
- build SDL for iOS, both static and dynamic
- build SDL test apps (as iOS .app bundles)
- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis)

To use, set the following CMake variables when running CMake's configuration stage:
- CMAKE_SYSTEM_NAME=iOS
- CMAKE_OSX_SYSROOT=<SDK>  (examples: iphoneos, iphonesimulator, iphoneos12.4, /full/path/to/iPhoneOS.sdk, etc.)
- CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures> (example: "arm64;armv7s")

Examples:
- for Simulator, using the latest, installed SDK:
    cmake path/to/SDL -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64

- for Device, using the latest, installed SDK, 64-bit only
    cmake path/to/SDL -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64

- for Device, using the latest, installed SDK, mixed 32/64 bit
    cmake path/to/SDL -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"

- for Device, using a specific SDK revision (iOS 12.4, in this example):
    cmake path/to/SDL -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64

- for Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
    cmake path/to/SDL -DSDL_TEST=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
2019-08-27 11:07:43 -04:00
Sam Lantinga 3fe2d8368c Updated SDL development builds to version 2.0.11 2019-09-22 10:37:16 -07:00
Sylvain Becker 0a9c74aa9a Fixed bug 3918 - HIDAPI, CMake support for android project 2019-08-27 11:38:43 +02:00
Sylvain Becker 155087d106 Fixed bug 3918 - CMake support for android project 2019-08-11 15:23:37 +02:00
Sam Lantinga e9ec7d41b3 Fixed bug 4354 - CMake builds do not correctly enable IME on Linux
Callum McGing

While the CMake build checks for ibus and does enable the ibus backend with set(HAVE_IBUS_IBUS_H TRUE), this does not define SDL_USE_IME, thus CMake built SDL2 (as in Arch Linux) cannot use IME at all.

The attached patch fixes this behaviour when building against ibus. IME support will still fail when only fcitx is available on the build system.
2019-08-05 23:46:09 -07:00
Alex Szpakowski aebaa316c7 Add public APIs for creating a Metal view attached to an SDL window. Add SDL_metal.h. 2019-08-05 12:35:32 -03: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 70f0b093ff 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 66d4d8e25d cmake: Added HIDAPI support. 2019-07-08 16:46:52 -04:00
Sam Lantinga 7f78d0f0d3 Fixed bug 4684 - GLES1 variables missing under Android with CMake
Braden Obrzut

https://hg.libsdl.org/SDL/file/7dc39b047055/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 67c67f3a6b Updated version to 2.0.10 2019-06-17 10:13:28 -07:00
Sam Lantinga 1b73d578f3 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 59483c6446 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 68bb8d6c13 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 50aab19877 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 510b01f5fc Fix WORKING_DIR parameter 2018-12-03 20:14:35 +02:00
Sam Lantinga f79190f407 Use _Exit() when available 2019-04-23 07:59:31 -07:00
Hugh McMaster af4bbb3064 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 8a5a05c168 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 d4a21f54b8 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 bc57ac27f9 mir: Removed mir client support.
Fixes Bugzilla #4288.
2018-11-02 21:34:17 -04:00
Ozkan Sezer 04761d7d6b CMakeLists.txt: set dylib version numbers properly. (bug #2915.) 2018-10-25 11:11:02 +03:00
Sam Lantinga c17d62996f 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 14d2ec80e7 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 b11c75e9f4 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 cf7460e477 configury, cmake: make wasapi option independent of directx. 2018-09-28 11:30:50 +03:00
Sam Lantinga bc6c199790 Updated version to 2.0.9 2018-09-26 10:08:14 -07:00
Drew Pirrone-Brusse 58021b3834 Correct the name of the SDL shared library in CMake for Mac OS 2018-08-18 17:23:40 -04:00
Sam Lantinga 8aaef4b914 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 c19516b50c cmake: correctly report Vulkan support at configure time (thanks, Tiago!).
Fixes Bugzilla #4262.
2018-09-18 11:49:42 -04:00
Ozkan Sezer 9753b9cc46 CMakeLists.txt: fix typo SDL_SENSORS_DISABLED -> SDL_SENSOR_DISABLED 2018-09-02 23:57:06 +03:00
Ryan C. Gordon df5d565f48 cmake: add sensor subsystem to the build. 2018-08-23 14:32:30 -04:00
Sam Lantinga 7c3040e08a First pass on the new SDL sensor API 2018-08-21 12:11:34 -07:00
Ethan Lee b4fe7412f9 SDL_exp 2018-08-04 11:52:46 -04:00
Ryan C. Gordon 4d4bb2b0ed cmake: use WINDOWS instead of WIN32. 2018-08-02 16:21:43 -04:00
Vitaly Novichkov 3a11bba267 Remove "lib" prefix from DLL file on MinGW builds
closes bug #4209.
2018-06-29 18:29:17 +03:00
Ozkan Sezer 8857791627 make WASAPI configurable in autofoo and cmake (default is on.)
closes bug #3798.
2018-07-01 17:01:04 +03:00
Sam Lantinga 5e8c81673f 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 9856d96777 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 6b5ed0fd49 Added debug postfix to install command and fixed library path 2018-04-10 08:03:54 -07:00
Micha? Janiszewski 0a5c10654c Fix ARM builds with MSVC 2018-03-10 21:16:14 -08:00
Olli Kallioinen 5cbb90da02 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 6cf4d0e43b 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 11c348b4d7 SDL_log10 2018-01-17 11:53:09 -05:00
Sam Lantinga c329381f4c 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 f1ec8a5f4c Check for immintrin.h before using it in SDL_cpuinfo.h 2017-12-11 12:00:12 -08:00
Ryan C. Gordon 351d6d4784 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
2017-12-06 12:24:32 -05:00
Sam Lantinga 57ebc72714 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