Commit graph

281 commits

Author SHA1 Message Date
Ryan C. Gordon 25fdba39bb
cmake: fix indentation. 2021-10-05 11:19:14 -04:00
Ryan C. Gordon f306662544
cmake: Correctly set IOS variable.
Fixes #4635.
2021-10-05 11:13:41 -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
Ryan C. Gordon ab09f3dae5
cmake: Remove warning about CFLAGS environment variable.
CMake 3.11.0 respects this environment var.

Fixes #4681.
2021-09-30 10:02:54 -04:00
Ryan C. Gordon cd6f96dede
cmake: bump minimum CMake allowed to 3.11.0.
This cmake is 3 years old, but it removes confusion about the CFLAGS
environment variable (as of CMake 3.10.0, reference PR #4681) and also
consolidates resolves the need to have a separate requirement for Windows
Store apps (which requires CMake 3.11.0).
2021-09-30 10:02:53 -04:00
Ryan C. Gordon f79ac6a8de
cmake: Don't use the CFLAGS environment variable.
CMake has standard means of setting compiler flags, such as the
-DCMAKE_C_FLAGS command line for general-purpose flags, and
-DCMAKE_BUILD_TYPE for letting it choose reasonable release/debug/etc
defaults. Trying to emulate the configure script is incorrect and confusing
here.

Fixes #1819.
2021-09-27 23:31:23 -04:00
Cameron Gutman 5dccffd7e4 Allow usage of the new Condition Variable code with Critical Sections
Vista and later provide the SleepConditionVariableCS() function for this.

Since SDL_syscond_srw.c doesn't require SRW locks anymore, rename it to
SDL_syscond_cv.c which better reflects the implementation of condition
variables rather than the implementation of mutexes.

Fixes #4051.
2021-09-17 19:38:09 -04:00
Ivan Epifanov 8d1e0ca324 Vita: add support for disabling 'screensaver' (screen dimming and suspend) 2021-09-16 09:03:17 -07:00
Cameron Cawley 67aacfe5c0 cmake: Retrieve the git revision on platforms without bash 2021-09-09 22:34:42 -04:00
Cameron Cawley 6301cfda95 cmake: Use the correct directory structure for MinGW builds 2021-09-09 22:34:42 -04:00
Ivan Epifanov 134dd46819 Add pvr gles/gles2 context support 2021-09-09 07:22:01 -07:00
Yao Wei Tjong 姚伟忠 76d50d2871 Force color diagnostics when applicable
Although GCC and Clang automatically generate color diagnostics on
terminal output, they do not do so when the compiler output is piped
through another process, like in the case for ninja-build and ccache.

Similarly, it would also be nice to be able to see the color diagnostics
on the CI build log in the web interface provided by the CI providers.
2021-08-24 07:44:38 -10:00
Ryan C. Gordon 374b0b9aaf
cmake: Don't support Vulkan if LOADSO is disabled.
Fixes #4373.
2021-08-24 00:01:46 -04:00
Sam Lantinga f5794f9eeb Added SDL_SetTextureUserData() and SDL_GetTextureUserData() to associate a user-specified pointer with an SDL texture 2021-08-10 15:17:59 -07:00
Sam Lantinga 3f6ebffff4 Updated to version 2.0.17 for development 2021-08-10 15:02:36 -07:00
Sam Lantinga 6810399352 Enable AAUDIO driver for Android
I thought this was already enabled for 2.0.16, but apparently not.

Fixes https://github.com/libsdl-org/SDL/issues/3710
2021-08-10 14:50:43 -07: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
Tomasz Kłoczko ea9bece5ed Fix breaking GNUInstallDirs cmake module $CMAKE_INSTALL_LIBDIR directory. Fix #4621
According to https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html
`${CMAKE_INSTALL_LIBDIR} ` is only variable which should be used as base
directory. Without that patch on 64 bit archs libraries, cmake modules and
pkgconfig file are installed for example in /usr/lib6464 base directory.
This patch fixes #4621.

Signed-off-by: Tomasz Kłoczko <koczek@github.com>
2021-08-10 14:47:53 -04:00
Sam Lantinga a91ab883e9 Fixed building on Windows with cmake, ninja, and clang 2021-08-06 12:28:24 -07:00
Sam Lantinga cdac61fffa Fixed typo 2021-08-06 12:00:53 -07:00
Sam Lantinga eec41d25de Add info on how to avoid the "Prevented in-tree build" message with CMake 2021-08-06 11:30:22 -07:00
Ryan C. Gordon b83a019d68
cmake: Force linker to treat input as a C++ program on Haiku.
Reference issue #4590.
2021-08-04 19:22:40 -04: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 c308453952 cmake: Use CMAKE_INSTALL_FULL_* for libdir,bindir,etc.
This makes sure sdl2.pc gets the full paths, matching what the
configure script will generate.

Fixes #4569.
2021-08-03 02:49:08 -04:00
Ozkan Sezer d373af044b CMakeLists.txt: update DYLIB_CURRENT_VERSION too 2.0.16 for release 2021-08-01 01:39:20 +03:00
Sam Lantinga cb1fd30e9a Updated to version 2.0.16 for release 2021-07-31 13:28:54 -07:00
Sam Lantinga 1a9253f752 Removed unused IOS_DYLIB definition 2021-07-31 12:37:28 -07:00
Christian Rauch 9e6fcbe72c wayland: client-side decoration 2021-07-25 14:54:12 -07:00
Joel Linn 20eea021c6 Windows: set HAVE_IMMINTRIN_H for AVX intrinsics 2021-07-24 15:39:17 -04:00
Ryan C. Gordon 6956f4aa19
cmake: use CMAKE_INSTALL_LIBDIR instead of hardcoding "lib", etc.
These came from HaikuPorts, specifically this patchset:

462947dd4f/media-libs/libsdl2/patches/libsdl2-2.0.14.patchset

This is just the part that is _not_ Haiku-specific. I wanted this in a
separate commit though, since I'm not really a CMake expert; if this causes
problems and we need to bisect to it, we won't be confused about it being a
Haiku issue when we get here.

Fixes #4092.
(and probably others.)
2021-07-24 11:06:40 -04:00
Ryan C. Gordon 403afdb558
cmake: Haiku fixes.
These came from HaikuPorts, specifically this patchset:

462947dd4f/media-libs/libsdl2/patches/libsdl2-2.0.14.patchset

This is just the Haiku-specific bits; the more general parts about install
dirs will be split into a different commit here.

Reference issue #4092.
2021-07-24 11:02:27 -04:00
Ozkan Sezer 5ac81c75fe fixed typo in previous commit 2021-07-10 10:05:40 +03:00
Ozkan Sezer a809d62605 cmake: set SDL_JOYSTICK_RAWINPUT for windows builds
Fixes: https://github.com/libsdl-org/SDL/issues/4412
2021-07-10 10:01:40 +03:00
h5p9sl e52733af8d Use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR
This allows for building with cmake's add_subdirectory() function.
2021-07-09 16:11:40 -07:00
Daniel Gibson e2234ee97c CMake: Fix SOVERSION/SONAME of non-release versions
When building SDL2 from git with CMake, you got libSDL2-2.0.so.1
instead of .0 (as it's the case when building with autotools).
This was caused by using LT_REVISION instead of LT_MAJOR for SOVERSION.

fixes #4310
2021-07-08 14:55:33 -07:00
Ozkan Sezer be41cf2dfe CMake: don't blacklist TARGET_OS_SIMULATOR for Metal configuration
7fa5e95b62 enabled it.
2021-07-08 21:20:02 +03:00
Croydon 3433f3c4cc CMake: Small improvement for MinGW
This is currently a small patch we have in our Conan package for SDL 4dc894cc2c/recipes/sdl2/all/conanfile.py (L184)

Introduced in 9fb93a6044
2021-07-07 16:55:17 -07:00
Ivan Epifanov 6460151c84 Vita: add missing stub 2021-07-01 15:14:49 -07:00
Ivan Epifanov 2465444fba Add missing dependencies 2021-06-14 11:53:19 -07:00
Ivan Epifanov bbdd08e0b2 Build without PIB support by default and add flag to enable it 2021-06-11 13:21:07 -04:00
Nicolas Caramelli 6a2af48ad7 CMake: Generic check for desktop GL and EGL on Linux systems 2021-06-01 16:50:28 -07:00
Cacodemon345 ded023870d Make CMake script more accurate to autoconf script
DBus, IBus and inotify is now able to be used outside Linux like in configure.
KMSDRM input is now working on FreeBSD with CMake compilation.
2021-06-01 15:34:52 -07:00
Ivan Epifanov ca969eb2be Remove gles2 vita render 2021-04-24 14:13:09 -07:00
Sylvain d4e96e1153
Android: enable audio driver OpenSLES when building with CMake 2021-04-16 09:44:07 +02:00
Sylvain 02b1ebc9e0
Android: add openslES and AAudio compilation to CMakeLists 2021-04-15 21:13:17 +02:00
Ozkan Sezer 69203851dc rename PKG_CONFIG_LIBS_PRIV to PKGCONFIG_LIBS_PRIV
i.e.: do not steal PKG_CONFIG namespace.
2021-04-14 21:40:50 +03:00
okuoku 401f485490 cmake: Weak link with CoreHaptics
Add link to CoreHaptics so we can compile against latest iOS SDKs.
2021-04-13 16:04:04 -07:00
Kyle Schaefer dbedaeceb3 Adding checks to see if any ASAN flags are set, if so then we set(HAVE_ASAN ON) so the infomartion output will properly list ASAN as on. 2021-04-13 16:03:37 -07:00