Commit Graph

276 Commits (main)

Author SHA1 Message Date
Anonymous Maarten 4b0f52b04e cmake: fall back to per-cpu test when all-in-one test fails
The 'all-in-one' test fails for Emscripten because try_compile does not copy back the actual binary:
the wasm file contains the machine parseable strings, not the html or js file(s).
2024-05-31 18:53:21 +02:00
Anonymous Maarten bba76859f5 cmake: detect CPU architecture in 1 compilation 2024-05-26 23:52:48 +02:00
Anonymous Maarten 86b2f441c0 release: create arm64 Visual Studio binaries
[skip ci]
2024-05-23 00:13:10 +02:00
Anonymous Maarten 3c00af1ac6 cmake: preseed CMake cache on MSVC to speed up configuration 2024-05-22 21:03:12 +02:00
Anonymous Maarten e10207e831 cmake: disallow '#include "SDL.h"' 2024-05-22 20:17:13 +02:00
Wim Taymans a340748c06 camera: add PipeWire camera support
The PipeWire camera will enumerate the pipewire Video/Source nodes with
their formats.

When capturing is started, a stream to the node will be created and
frames will be captured.
2024-05-09 13:19:27 -07:00
Frank Praznik fb4c15319e pipewire: Raise minimum build version to 0.3.44 2024-04-19 12:34:22 -04:00
Anonymous Maarten 9f83647aec cmake: switch iOS and watchOS 2024-04-08 19:25:38 +02:00
Ravbug 2d640d0b59
ci: Add iOS and tvOS CMake GitHub Actions checks (#9465)
- Also add watchos support to CMake (SDL does not support this platform yet)

Co-authored-by: Ravbug <ravbug@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-04-08 19:18:28 +02:00
Robert Edmonds e3395a7585 cmake: Fix ALSA "Unable to find..." warning
If cmake is invoked with -DSDL_ALSA=OFF, the misleading warning
message "Unable to find the alsa development library" is printed.
It's misleading because no attempt was actually made to find the ALSA
development library. It's always printed by the CheckALSA macro if
SDL_ALSA is false.

This commit moves this warning message in the CheckALSA macro to being
printed if ALSA_FOUND is false. However, I don't see an explicit warning
message like this for the other macros that search for development
libraries, so I wonder if the message shouldn't just be removed
entirely. It seems redundant with the "Could NOT find ALSA ..." message
generated by cmake.

Before this commit:

    $ cmake -B build -DSDL_ALSA=OFF
    [...]
    CMake Warning at cmake/sdlchecks.cmake:125 (message):
      Unable to find the alsa development library
    Call Stack (most recent call first):
      CMakeLists.txt:1530 (CheckALSA)
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: OFF): OFF
    [...]

    $ cmake -B build -DSDL_ALSA=ON
    [...]
    -- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: ON): OFF
    [...]

After this commit:

    $ cmake -B build -DSDL_ALSA=OFF
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: OFF): OFF
    [...]

    $ cmake -B build -DSDL_ALSA=ON
    [...]
    -- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
    CMake Warning at cmake/sdlchecks.cmake:123 (message):
      Unable to find the alsa development library
    Call Stack (most recent call first):
      CMakeLists.txt:1530 (CheckALSA)
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: ON): OFF
    [...]

All of the cmake invocations above were without the libasound2-dev
package installed.
2024-04-06 12:19:55 -04:00
Anonymous Maarten 2f26c58504 cmake: fix typo in cmake/sdlplatform.cmake 2024-04-02 23:44:15 +02:00
Anonymous Maarten 63cb541797 cmake: set SYSTEM property in SDL3Config.cmake for compatibility with older CMake versions 2024-04-01 20:09:51 +02:00
Anonymous Maarten 75a71bde4b cmake: build tests against installed SDL prefix 2024-03-23 21:41:20 +01:00
Anonymous Maarten f59dbf6a12 cmake: add -Wimplicit-fallthrough warning 2024-03-18 20:34:50 +01:00
Anonymous Maarten b5eb704fa8 cmake: we only need a C++ compiler for Android, Haiku and UWP
Our CMake script does (currently) not support NGage, Xbox One, or Xbox Series.
2024-03-11 00:27:54 +01:00
Anonymous Maarten 7341d5f361 cmake: allow hidapi to use libusb on Windows
When using SDL_HIDAPI_LIBUSB_SHARED=ON, extract the dll file name
from the import library.
2024-03-10 09:07:33 -07:00
Anonymous Maarten 0e6fcf947a cmake: find libusb through LibUSB cmake module 2024-03-10 09:07:33 -07:00
Anonymous Maarten 3cc4705dd2 cmake: build OBJC sources with warning & error flags, ignoring deprecated declarations 2024-03-07 01:58:28 +01:00
Anonymous Maarten 1f536a1e77 cmake: fix SDL_RENDER_VULKAN reporting
Also fix an error when configuring with `-DSDL_VULKAN=ON
-DSDL_RENDER_VULKAN=FALSE`: the vulkan renderer is now correctly
disabled.
2024-02-26 20:37:10 +01:00
Dan Ginsburg cab20117e6
Vulkan Renderer (#9114)
This pull request adds an implementation of a Vulkan Render backend to SDL.  I have so far tested this primarily on Windows, but also smoke tested on Linux and macOS (MoltenVK).  I have not tried it yet on Android, but it should be usable there as well (sans any bugs I missed).  This began as a port of the SDL Direct3D12 Renderer, which is the closest thing to Vulkan as existed in the SDL codebase. The shaders are more or less identical (with the only differences being in descriptor bindings vs root descriptors).  The shaders are built using the HLSL frontend of glslang.

Everything in the code is pure Vulkan 1.0 (no extensions), with the exception of HDR support which requires the Vulkan instance extension `VK_EXT_swapchain_colorspace`.  The code could have been simplified considerably if I used dynamic rendering, push descriptors, extended dynamic state, and other modern Vulkan-isms, but I felt it was more important to make the code as vanilla Vulkan as possible so that it would run on any Vulkan implementation.

The main differences with the Direct3D12 renderer are:
* Having to manage renderpasses for performing clears.  There is likely some optimization that would still remain for more efficient use of TBDR hardware where there might be some unnecessary load/stores, but it does attempt to do clears using renderpasses.
* Constant buffer data couldn't be directly updated in the command buffer since I didn't want to rely on push descriptors, so there is a persistently mapped buffer with increasing offset per swapchain image where CB data gets written.
* Many more resources are dependent on the swapchain resizing due to i.e. Vulkan requiring the VkFramebuffer to reference the VkImageView of the swapchain, so there is a bit more code around handling that than was necessary in D3D12.
* For NV12/NV21 textures, rather than there being plane data in the texture itself, the UV data is placed in a separate `VkImage`/`VkImageView`.

I've verified that `testcolorspace` works with both sRGB and HDR linear.  I've tested `testoverlay` works with the various YUV/NV12/NV21 formats.  I've tested `testsprite`.  I've checked that window resizing and swapchain out-of-date handling when minimizing are working.  I've run through `testautomation` with the render tests.  I also have run several of the tests with Vulkan validation and synchronization validation.  Surely I will have missed some things, but I think it's in a good state to be merged and build out from here.
2024-02-22 14:58:11 -08:00
Frank Praznik 8b6eae2d4f cmake: Split and store the libdecor version as individual parts
It is becoming necessary to enable additional features as libdecor continues to evolve, and checking against a single base version will no longer be adequate. Libdecor doesn't provide versioning defines in its headers, so split the version string into parts to allow for discrete version detection and feature enablement at build time.
2024-02-20 11:28:02 -05:00
Simon McVittie a06ee5b98d Don't try to use SDL platform macros in configure-time checks
At the point that we run this, nothing SDL-specific is set up yet.
__APPLE__ is a compiler predefined macro that forms part of the API on
Apple platforms, so it's fine to rely on it.

This partially reverts commit 31d133db.

Fixes: 31d133db "Define SDL_PLATFORM_* macros instead of underscored ones (#8875)"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-24 14:12:50 +03:00
Anonymous Maarten 31d133db40
Define SDL_PLATFORM_* macros instead of underscored ones (#8875) 2024-01-24 01:40:51 +00:00
Sam Lantinga 5db543a66a Just use the khronos headers for the checks that need them 2024-01-19 23:55:05 -08:00
Sam Lantinga c540c77756 Removed SDL_INIT_EVERYTHING
Fixes https://github.com/libsdl-org/SDL/issues/8709
2024-01-18 06:17:58 -08:00
Sam Lantinga ac367be171 Updated CMakeLists.txt now that timers and threads can't be disabled 2024-01-17 09:24:04 -08:00
Anonymous Maarten dd5b8db3a6 SDL_hidapi requires libusb >= 1.0.16
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-11-24 21:31:59 +01:00
Anonymous Maarten a45b371de0 cmake: create and install SDL3::Jar target for Android 2023-11-23 02:13:08 +01:00
Sylvain d8600f717e Pointer as bool (libsdl-org#7214) 2023-11-09 14:18:36 -08:00
Anonymous Maarten 391a3d23d0 cmake: the compile-time pdb does not have a suffix, if set 2023-11-09 03:28:20 +01:00
Anonymous Maarten a6541166bc cmake: also install pdb files of static libraries 2023-11-09 02:17:07 +01:00
Wohlstand 0a1b6b270f sdlchecks.cmake: Clarified the reason why shared X11 mode doesn't work
#6778
2023-11-08 02:57:28 -08:00
Frank Praznik 1a57f6bb29 wayland: Remove QtWayland extensions
These were added a very long time ago and seem to serve no purpose now, as the functionality they provided is now in core Wayland protocols, current information on their usage and status is nonexistent, no modern compositor seems to support them, and the code paths are untested and subject to bit-rot at this point. It also causes duplicate symbol issues when statically linking an application to both Qt and SDL.
2023-11-07 11:00:32 -05:00
Anonymous Maarten 459f17257c cmake: fix MSVC unrecognized option link warning 2023-11-06 01:58:26 +01:00
Anonymous Maarten 761390b62f cmake: detect linker id, and assume MSVC does not support version scripts 2023-11-06 00:41:00 +01:00
Jamie Madill 59b37d0e5b
cmake: fix Windows unrecognized option link warning
This fixes a warning that could show up on some MS linkers which use a
slightly different warning message than expected.

Amends check_linker_supports_version_file to include the "unrecognized
option" warning message.
2023-11-05 16:28:22 +00:00
Anonymous Maarten 4aacc4b92e cmake: file(RELATIVE_PATH) needs 2 absolute paths 2023-10-30 19:50:35 +01:00
Anonymous Maarten 6127ac0871 Use SDL_DISABLE_ALLOCA instead of HAVE_ALLOCA in SDL_stdinc.h 2023-10-28 18:54:12 +02:00
Anonymous Maarten 3a36433a3c cmake: test -Wl,--version-script with minimal version script
Android ndk 26 errors when a symbol in the version script is not defined.
2023-10-12 14:00:47 +02:00
Anonymous Maarten ebf5e08fa1 cmake: use *_STATIC_* variables when linking to a static ffmpeg 2023-10-10 03:32:46 -07:00
Sam Lantinga 88f2fb9dcf Added an example of video decoding with ffmpeg 2023-10-10 03:32:46 -07:00
Anonymous Maarten 5be5000fa1 cmake: make HEADERS_DIR a required argument of SDL_generate_manpages 2023-09-29 03:42:33 +02:00
Ryan C. Gordon 280c2c1d7d
pulseaudio: Revert "pulseaudio: Require PulseAudio 5.0 or later for SDL3."
This reverts commit 6fd0613ac8.

Turns out that the Steam Runtime is still on PulseAudio 1.1, and the only
thing we (currently) need a newer Pulse for is pa_threaded_mainloop_set_name,
so let's just go back to treating that symbol as optional.

We might need to force a higher version at some point, but it's not worth it
over this.
2023-09-28 10:19:24 -04:00
Frank Praznik 2a1058713c Bump libdecor feature check to look for 0.2.0
The version of libdecor tagged with support for the suspended event and min/max getters is 0.2.0, so update the checks to reflect this.
2023-09-25 12:07:54 -04:00
Anonymous Maarten e85206ffd8 wikiheaders.pl: add --rev= option to pass revision string
This way, git is not required anymore to calculate the git revision
2023-09-04 18:56:00 +02:00
Sam Lantinga bbe2e012a2 Don't provide the SDL3 header path
The recommended way to include SDL.h is #include <SDL3/SDL.h>, and having both paths available was confusing for people trying to port to SDL3.

Thanks for the feedback!
https://github.com/exult/exult/issues/379#issuecomment-1701066992
2023-08-31 11:41:37 -07:00
Ozkan Sezer f617918e0a cmake: check linkage to libusb too, instead of libusb.h presence only.
avoids false positives when using a cross-toolchain file
2023-08-26 17:03:42 +02:00
Anonymous Maarten c2f388fd88 cmake: add SDL_HIDAPI_LIBUSB_SHARED option + test on ci 2023-08-14 19:37:58 +02:00
Vlad-Stefan Harbuz 796713b9d5 xxd.py: always write \n line endings
Previously, `open()` was used with the default option of `newline=None`,
which means that “any '\n' characters written are translated to the
system default line separator”. Now, `xxd.py` always writes `\n` line
endings. This eliminates the need for the .gitattributes file.
2023-08-13 13:51:31 -07:00
Anonymous Maarten a5d9db0cd0 cmake: build tests for UWP 2023-08-12 17:37:52 +02:00