CMakeLists.txt


Log

Author Commit Date CI Message
Tomasz Kłoczko ea9bece5 2021-08-10T18:51:33 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>
Sam Lantinga a91ab883 2021-08-06T12:28:03 Fixed building on Windows with cmake, ninja, and clang
Sam Lantinga cdac61ff 2021-08-06T12:00:53 Fixed typo
Sam Lantinga eec41d25 2021-08-06T11:30:22 Add info on how to avoid the "Prevented in-tree build" message with CMake
Ryan C. Gordon b83a019d 2021-08-04T19:22:10 cmake: Force linker to treat input as a C++ program on Haiku. Reference issue #4590.
Ozkan Sezer 5b18ae29 2021-08-03T14:01:02 improvements to libdecor support in cmake this makes it consistent with wayland support, and makes cmake side in line with autotools' libdecor support.
Ozkan Sezer a15ec365 2021-08-03T11:33:50 attempt to fix cmake builds with libdecor
Ryan C. Gordon c3084539 2021-08-03T02:49:08 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.
Ozkan Sezer d373af04 2021-08-01T01:39:20 CMakeLists.txt: update DYLIB_CURRENT_VERSION too 2.0.16 for release
Sam Lantinga cb1fd30e 2021-07-31T13:28:54 Updated to version 2.0.16 for release
Sam Lantinga 1a9253f7 2021-07-31T12:37:28 Removed unused IOS_DYLIB definition
Christian Rauch 9e6fcbe7 2020-06-11T22:10:28 wayland: client-side decoration
Joel Linn 20eea021 2021-06-12T01:25:40 Windows: set HAVE_IMMINTRIN_H for AVX intrinsics
Ryan C. Gordon 6956f4aa 2021-07-24T11:06:40 cmake: use CMAKE_INSTALL_LIBDIR instead of hardcoding "lib", etc. These came from HaikuPorts, specifically this patchset: https://github.com/haikuports/haikuports/blob/462947dd4f285a885d8011cade7cd0f7151cfe74/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.)
Ryan C. Gordon 403afdb5 2021-07-24T11:02:27 cmake: Haiku fixes. These came from HaikuPorts, specifically this patchset: https://github.com/haikuports/haikuports/blob/462947dd4f285a885d8011cade7cd0f7151cfe74/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.
Ozkan Sezer 5ac81c75 2021-07-10T10:05:40 fixed typo in previous commit
Ozkan Sezer a809d626 2021-07-10T10:01:40 cmake: set SDL_JOYSTICK_RAWINPUT for windows builds Fixes: https://github.com/libsdl-org/SDL/issues/4412
h5p9sl e52733af 2021-07-09T13:39:05 Use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR This allows for building with cmake's add_subdirectory() function.
Daniel Gibson e2234ee9 2021-05-16T06:33:29 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
Ozkan Sezer be41cf2d 2021-07-08T21:20:02 CMake: don't blacklist TARGET_OS_SIMULATOR for Metal configuration https://github.com/libsdl-org/SDL/commit/7fa5e95b6284f2cc7855022c9f0c2b086dcee43f enabled it.
Croydon 3433f3c4 2021-07-08T01:18:01 CMake: Small improvement for MinGW This is currently a small patch we have in our Conan package for SDL https://github.com/bincrafters/community/blob/4dc894cc2c4df43aabf39c212aa0a31047d183e1/recipes/sdl2/all/conanfile.py#L184 Introduced in https://github.com/bincrafters/conan-sdl2/commit/9fb93a60446914da2a0fafc692cbd175c2d5db50
Ivan Epifanov 6460151c 2021-06-21T15:03:31 Vita: add missing stub
Ivan Epifanov 2465444f 2021-06-14T21:27:09 Add missing dependencies
Ivan Epifanov bbdd08e0 2021-06-10T13:20:39 Build without PIB support by default and add flag to enable it
Nicolas Caramelli 6a2af48a 2021-05-06T15:43:16 CMake: Generic check for desktop GL and EGL on Linux systems
Cacodemon345 ded02387 2021-05-16T17:16:54 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.
Ivan Epifanov ca969eb2 2021-04-24T10:29:52 Remove gles2 vita render
Sylvain d4e96e11 2021-04-16T09:44:07 Android: enable audio driver OpenSLES when building with CMake
Sylvain 02b1ebc9 2021-04-15T21:13:17 Android: add openslES and AAudio compilation to CMakeLists
Ozkan Sezer 69203851 2021-04-14T21:40:50 rename PKG_CONFIG_LIBS_PRIV to PKGCONFIG_LIBS_PRIV i.e.: do not steal PKG_CONFIG namespace.
okuoku 401f4854 2021-04-11T19:29:01 cmake: Weak link with CoreHaptics Add link to CoreHaptics so we can compile against latest iOS SDKs.
Kyle Schaefer dbedaece 2021-04-11T15:10:28 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.
Kyle Schaefer 70bd205b 2021-04-11T15:08:14 Adding messages to output CMAKE_C_FLAGS_DEBUG and CMAKE_CXX_FLAGS_DEBUG, this way when using Debug builds you can see which debug flags are set
Kyle Schaefer 32066604 2021-04-11T15:05:58 Moving ASAN macros and calls to macros above the information output section so we can display ASAN information properly.
okuoku 732cc8ed 2021-04-08T21:28:45 cmake: Fix UWP DLL build by removing /NODEFAUTLIB On UWP, we need default C runtime for C++ sources.
Vladislav Dmitrievich Turbanov 50db4a59 2021-04-02T12:05:45 * Support for intrinsics in MSW + Clang scenario. Utility polyfill is provided, removed the no-longer-needed conditionals.
okuoku 7b8c7509 2021-04-03T22:21:35 CMake: Enable WASAPI on WinRT WASAPI backend on WinRT was implemented with 2.0.8 https://github.com/libsdl-org/SDL/commit/351d6d478443fe8a1ede1e993712f07cb369d483 but CMake source here was written for 2.0.7 in vcpkg https://github.com/microsoft/vcpkg/commit/e6c65b93b125cf0be13254cf2f5a9d27cb009707
Ryan C. Gordon a81fe272 2021-04-04T00:16:30 configure/cmake: Hook up Emscripten threads (disabled by default). Fixes #3795.
vanfanel e213f37a 2021-03-15T12:53:16 [KMSDRM] Enable full OpenGL detection (MESA/libglvnd) on both the make and cmake buildsystems.
Ivan Epifanov e58a955e 2021-03-08T18:39:00 Deprecate dolcesdk
Ivan Epifanov 4708c6bb 2021-02-14T11:52:43 Remove pkg-config prefix hack
uyjulian b52e9459 2021-01-29T01:26:13 Add support for open URL
Ivan Epifanov a43f4889 2021-01-20T23:33:05 Don't search for pthread
Ivan Epifanov 54134fdd 2021-01-10T00:09:46 Use Clib mem funcs
Ivan Epifanov e928b92f 2020-12-18T16:42:57 CMake support
Ozkan Sezer 34ecd71e 2021-03-04T18:44:04 CMake: don't add -Wl,--no-undefined to LDFLAGS for clang+windows cases from a patchset by Vladislav Dmitrievich Turbanov: https://github.com/libsdl-org/SDL/pull/4062
Ozkan Sezer 3880174a 2021-03-04T18:40:56 CMake: set OPT_DEF_LIBC to ON for clang case, too. from a patchset by Vladislav Dmitrievich Turbanov: https://github.com/libsdl-org/SDL/pull/4062
Ozkan Sezer 05cc9e37 2021-03-04T18:40:50 CMake: move GCC check after CLANG, so that CLANG is properly recognized from a patchset by Vladislav Dmitrievich Turbanov: https://github.com/libsdl-org/SDL/pull/4062
Ozkan Sezer 0a683221 2021-03-01T15:11:50 add missing PIPEWIRE defines to SDL_config.h.in also specify 'audio' in Pipepire configuration enable messages.
Frank Praznik 2f0b99a7 2021-02-13T11:56:05 audio: Add Pipewire playback/capture sink
Joshua Saxby fe6f62e6 2021-02-10T15:17:02 Add ALIAS targets to all installed SDL2 targets This provides a linking interface that matches the one available when `find_package()` is used, by aliasing all of SDL's public targets into the SDL2:: namespace. Thus, dependees link to the same-named targets regardless of how SDL was acquired. This approach permits the use of wrappers around CMake's FetchContent API such as https://github.com/cpm-cmake/CPM.cmake
Christian Rauch 2170c7bf 2021-02-08T23:55:50 make AddressSanitizer optional and disabled by default
Christian Rauch 5045d299 2021-02-08T20:50:00 enable AddressSanitizer only for GCC 5 onwards (bug #5533)
Christian Rauch 066960c2 2021-02-08T02:15:50 add '-shared-libasan' to debug flags (bug #5533)
Ozkan Sezer bb9e049d 2021-02-07T00:37:00 minor updates to libc function checks
Sam Lantinga 2426949a 2021-02-01T21:56:56 Removed support for clock_gettime_nsec_np() SDL_GetTicks() was broken and it's not adding any real value here.
Christian Rauch 42798cec 2021-02-01T20:25:24 cmake: enable AddressSanitizer in Debug builds if supported
Sam Lantinga b7f711cd 2021-01-31T19:11:49 Don't enable address sanitize flags without checking compiler first
Christian Rauch f8b4a6e2 2021-01-31T19:09:25 cmake: enable AddressSanitizer in Debug builds
Ozkan Sezer 091a4649 2021-01-29T23:11:13 added --enable-xinput switch for windows builds
Sam Lantinga de1c19b3 2021-01-25T20:43:21 Fixed bug 5481 - iOS-specific main sources not used for CMake build. Aaron Barany The CMake build for SDL doesn't set SDLMAIN_SOURCES on iOS to the sources in src/main/ios. As a result, SDL fails to initialize since it falls back to the dummy main. Adding the line file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c) fixes the issue.
Ozkan Sezer aa4a6b0b 2021-01-25T04:11:40 better check for clock_gettime_nsec_np() -- cf. bug #5467.
Ozkan Sezer d327bbfb 2021-01-24T17:37:24 CMakeLists.txt: fix check_symbol_exists() for clock_gettime_nsec_np
Sam Lantinga 96cfb812 2021-01-23T09:50:43 Fixed bug 5467 - SDL sys timer Mac OS update proposal David Carlier Change of api from 2016 which reduce code complexity a bit.
Ozkan Sezer f3835702 2021-01-17T05:00:50 fix build with --disable-directx
Sam Lantinga d54b125a 2021-01-14T14:53:34 Fixed bug 5287 - Support building for UWP with CMake Jan Niklas Hasse Actually the SDL2-static target works, if I set SDL_SENSOR to OFF. Awesome! See this patch: https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/0003-sdl2-fix-uwp-build.patch
Ozkan Sezer 8a32ee24 2020-12-30T01:00:24 removed MSVC strtok_s use from SDL_strtokr(). no other ??_s are used elsewhere in SDL_stdinc. besides, C11 has a strtok_s with a different signature.
Joel Linn 2443e51e 2020-12-28T11:42:49 Add optional suffix `_generic` to generic SDL_cond impl Allows for runtime selectable implementation
Ozkan Sezer 471d3c36 2020-12-27T14:00:30 fix bug #5415 -- fatal error: 'Cocoa/Cocoa.h' file not found in iOS build
Ozkan Sezer 9f6fddb4 2020-12-27T05:20:10 CMake: don't check for --no-undefined linker flag for OpenBSD (bug #5174) it now matches autotools.
Sam Lantinga 93ccdee8 2020-12-23T13:47:49 Fixed bug 5404 - stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf Cameron Cawley stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf The default implementation is based on the one used in the Windows RT video driver.
Ozkan Sezer b4b674da 2020-12-22T22:10:50 CMakeLists.txt: sync DYLIB_CURRENT_VERSION to Xcode project
Sam Lantinga 350f1b0d 2020-12-22T10:36:15 Updated SDL to version 2.0.15 for development
Manuel Alfayate Corchete 13244de5 2020-12-22T17:17:30 [Buildsystem] Only build KMSDRM support if EGL+OpenGL is detected by CMake.
Ozkan Sezer 22275b35 2020-12-20T21:55:02 cmake: fix building for mac (bug #5407.)
Sam Lantinga 6bd4c717 2020-12-17T21:41:23 Fixed bug 5402 - ARM support little update proposal David Carlier No fix but mostly an update for ARM architecture.
Ozkan Sezer b6e63625 2020-12-13T15:32:24 fix bug #5395: handle old systems where inotify_init1 is not available
Sam Lantinga 45e3521d 2020-12-09T07:32:10 Backed out changes for 5366 - cmake build doesn't detect Metal on macOS These changes introduce regressions for other build environments, so I'm backing them out until we sort out the correct fix.
Sam Lantinga 479db430 2020-12-09T06:56:34 Fixed bug 5250 - updaterev.sh failed using CMake Tools on VSCode Remote Sebastian Vargas Vargas Running CMake configure from a Windows Subsystem for Linux using Visual Studio Code Remote doesn't generate the header file with the current source revision, it throws "/home/sebva/SDL/build-scripts/updaterev.sh: 13: cannot create /mnt/c/Users/sebva/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/include/SDL_revision.h.new: Directory nonexistent".
Sam Lantinga 42c5b4ac 2020-12-09T06:17:55 Fixed bug 5366 - cmake build doesn't detect Metal on macOS Tom Seddon 2nd time lucky, perhaps. patch 2 applies to current HEAD at time of writing - 4eb049c9bb1ca94efe3c40b57beda3169984d0cb from https://github.com/SDL-mirror/SDL. This basically goes back to what was there originally, but now manually adding "-x objective-c" to the clang command line rather than "-ObjC". clang is then invoked without the "-x c" that was causing the problem, the snippet builds, and Metal is detected. (I had a quick trawl through the cmake code, but I couldn't see where this is handled.) I was moved to try this after finding SDL's own CHECK_OBJC_SOURCE_COMPILES macro, and noting what it does: https://github.com/SDL-mirror/SDL/blob/4eb049c9bb1ca94efe3c40b57beda3169984d0cb/cmake/macros.cmake#L67 An alternative fix of course would be to use CHECK_OBJC_SOURCE_COMPILES instead of cmake's check_objc_source_compiles - but that had the same problem of getting confused by "return 0;". (Maybe that's because it's a macro? I'll defer to a cmake expert on this one.) I decided in the end to err on the side of leaving things looking basically the same as they were before my first patch.
Ozkan Sezer 475405e0 2020-12-09T12:03:24 CMakeLists.txt: sync DYLIB_CURRENT_VERSION to Xcode project
Ozkan Sezer 250a0557 2020-12-09T12:01:10 fix bug #5384 -- define DLL_EXPORT in DLL builds and adjust begin_code.h
Sam Lantinga a2098a47 2020-12-08T18:56:06 Updated SDL to 2.0.14 in preparation for release candidate
Sam Lantinga 2a9591a9 2020-12-08T09:16:34 Accepted patch https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/fix-space-in-path.patch
Sam Lantinga 7f1c6e82 2020-12-08T09:13:08 Accepted patch https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/enable-winrt-cmake.patch
Sam Lantinga 7665f887 2020-12-08T09:07:21 Accepted patch https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/disable-wcslcpy-and-wcslcat-for-windows.patch
Sam Lantinga 695499ae 2020-12-08T09:04:28 Accepted patch https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/disable-hidapi-for-uwp.patch
Sam Lantinga 4b35a18d 2020-12-01T13:50:42 Fixed bug 5366 - cmake build doesn't detect Metal on macOS Tom Seddon This is as of commit 50d804ea729accf9e3a9ce83238d0a2976a17545 from https://github.com/SDL-mirror/SDL, which is HEAD as I write (apologies, not confident with Mercurial) # Config macOS: 10.14.6 (18G6042) cmake --version: cmake version 3.16.20200101-g23e782c clang --version: Apple clang version 11.0.0 (clang-1100.0.33.17) Xcode version: Version 11.3.1 (11C504) # Repro steps Run the following commands in the shell. cd /tmp/ git clone https://github.com/SDL-mirror/SDL mkdir build.SDL cd build.SDL cmake -G ../SDL/ Examine cmake output. # Expected result Metal is detected. # Actual result It appears that Metal is not detected! Note this line in the summary: -- RENDER_METAL (Wanted: 0): OFF # Fix Change check_c_source_compiles to check_objc_source_compiles. The cmake script tries to add -ObjC to the clang command line, but, for whatever reason, this doesn't seem to work. Change the test source to have an empty main. The "return 0;" line seems to confuse cmake somehow, causing it to crap out with an error about HAVE_FRAMEWORK_METAL being an unknown argument. (Maybe I'm just dense, but it's not obvious to me what the problem is here.) With these two changes: -- RENDER_METAL (Wanted: ON): ON Patch attached.
Ozkan Sezer e5783e11 2020-11-25T14:51:56 cmake: add missing checks for wcscasecmp, _wcsicmp, wcsncasecmp, _wcsnicmp
Ozkan Sezer 711d4090 2020-11-24T14:10:30 CMakeLists.txt: add src/joystick/iphoneos/*.m to Darwin joystick sources .. so that there won't be missing symbols. TODO: add checks for SDL_JOYSTICK_MFI ???
Ozkan Sezer 4c96faee 2020-11-23T20:37:10 remove non-existing tslib support from autofoo and cmake
Simon McVittie 8db3171b 2020-11-11T19:14:34 udev: Factor out SDL_EVDEV_GuessDeviceClass This works on capability bitfields that can either come from udev or from ioctls, so it is equally applicable to both udev and non-udev input device detection. Signed-off-by: Simon McVittie <smcv@collabora.com>
Ozkan Sezer 2daa670c 2020-10-13T15:20:03 cmake: look for iconv in libc, too (bug #5316.)
Ozkan Sezer 67568518 2020-10-13T14:45:10 cmake: run updaterev.sh if(NOT CMAKE_HOST_WIN32) ... not if(NOT WINDOWS OR CYGWIN) This way, it generates SDL_revision.h in cross-build environments too.
Ozkan Sezer 665cfa49 2020-10-13T14:32:15 cmake: check for alloca() in stdlib.h and malloc.h, too (bug #5316)
Ozkan Sezer 48c03d9a 2020-10-12T02:40:00 cmake: reduce STDC_HEADER_NAMES list to only relevant headers, i.e. stddef.h, stdarg.h, stdlib.h, string.h, stdio.h, wchar.h, float.h. Fixes issue described at: https://bugzilla.libsdl.org/show_bug.cgi?id=4885#c2
Ozkan Sezer 196cda69 2020-10-12T01:02:28 build: fix / update sensors (windows) configuration - SDL_config.h.in: add missing defines SDL_SENSOR_COREMOTION and SDL_SENSOR_WINDOWS (configure did set SDL_SENSOR_WINDOWS but it never went in SDL_config.h or Makefile.) - SDL_config.h.cmake: remove duplicated SDL_SENSOR_XXX cmake defines. - autofoo, cmake: check for sensorsapi.h header before enabling windows sensors.
Cameron Cawley 59022829 2020-10-11T17:32:32 riscos: Implement SDL_OpenURL()
Ryan C. Gordon 77c9d73b 2020-10-05T11:30:33 Removed SDL_AndroidOpenURL, added SDL_OpenURL. Still needs to be wired into Xcode and Visual Studio projects.
stfx b1626295 2020-07-08T17:28:34 cmake: Fix building with -DSDL_HAPTIC=Off