diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index 1e407022831..9f38e923d4f 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -1,6 +1,7 @@ include(libweb_generators) include(vulkan) include(skia) +include(SDL3) find_package(unofficial-angle CONFIG) if(unofficial-angle_FOUND) @@ -1084,7 +1085,7 @@ set(GENERATED_SOURCES ladybird_lib(LibWeb web EXPLICIT_SYMBOL_EXPORT) -target_link_libraries(LibWeb PRIVATE LibCore LibCompress LibCrypto LibJS LibHTTP LibGfx LibIPC LibRegex LibSyntax LibTextCodec LibUnicode LibMedia LibWasm LibXML LibIDL LibURL LibTLS LibRequests LibGC LibThreading skia ${ANGLE_TARGETS}) +target_link_libraries(LibWeb PRIVATE LibCore LibCompress LibCrypto LibJS LibHTTP LibGfx LibIPC LibRegex LibSyntax LibTextCodec LibUnicode LibMedia LibWasm LibXML LibIDL LibURL LibTLS LibRequests LibGC LibThreading skia ${ANGLE_TARGETS} SDL3::SDL3) # FIXME: https://github.com/microsoft/vcpkg/issues/42324 target_include_directories(LibWeb PRIVATE ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include) diff --git a/Meta/CMake/SDL3.cmake b/Meta/CMake/SDL3.cmake new file mode 100644 index 00000000000..918b20667d5 --- /dev/null +++ b/Meta/CMake/SDL3.cmake @@ -0,0 +1,3 @@ +include_guard() + +find_package(SDL3 CONFIG REQUIRED) diff --git a/Meta/CMake/flatpak/org.ladybird.Ladybird.json b/Meta/CMake/flatpak/org.ladybird.Ladybird.json index 8a8148a0a0d..4b5a33d1681 100644 --- a/Meta/CMake/flatpak/org.ladybird.Ladybird.json +++ b/Meta/CMake/flatpak/org.ladybird.Ladybird.json @@ -9,6 +9,7 @@ "command": "Ladybird", "finish-args": [ "--device=dri", + "--device=input", "--share=ipc", "--share=network", "--socket=wayland", @@ -506,6 +507,22 @@ "-DFASTFLOAT_INSTALL=ON" ] }, + { + "name": "sdl3", + "buildsystem": "cmake-ninja", + "sources": [ + { + "type": "git", + "url": "https://github.com/libsdl-org/SDL.git", + "tag": "release-3.2.20" + } + ], + "config-opts": [ + "-DCMAKE_BUILD_TYPE=Release", + "-DCMAKE_PREFIX_PATH=/app", + "-DCMAKE_INSTALL_LIBDIR=lib" + ] + }, { "name": "Ladybird", "buildsystem": "cmake-ninja", diff --git a/Services/WebContent/CMakeLists.txt b/Services/WebContent/CMakeLists.txt index 1da97b3823f..1518d0ecf21 100644 --- a/Services/WebContent/CMakeLists.txt +++ b/Services/WebContent/CMakeLists.txt @@ -1,4 +1,5 @@ include(audio) +include(SDL3) set(SOURCES ConnectionFromClient.cpp @@ -31,6 +32,7 @@ target_include_directories(webcontentservice PUBLIC $ #endif +#include + static ErrorOr load_content_filters(StringView config_path); static ErrorOr initialize_resource_loader(GC::Heap&, int request_server_socket); @@ -60,6 +62,12 @@ ErrorOr ladybird_main(Main::Arguments arguments) { AK::set_rich_debug_enabled(true); + // SDL is used for the Gamepad API. + if (!SDL_Init(SDL_INIT_GAMEPAD)) { + dbgln("Failed to initialize SDL3: {}", SDL_GetError()); + return -1; + } + #if defined(HAVE_QT_MULTIMEDIA) QCoreApplication app(arguments.argc, arguments.argv); diff --git a/vcpkg.json b/vcpkg.json index 73f175e8550..3546b8f674e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -25,6 +25,11 @@ "zstd" ] }, + { + "name": "dbus", + "default-features": false, + "platform": "linux" + }, { "name": "dirent", "platform": "windows" @@ -151,6 +156,10 @@ "name": "pthread", "platform": "windows" }, + { + "name": "sdl3", + "default-features": false + }, "simdutf", { "name": "skia", @@ -201,6 +210,10 @@ "name": "curl", "version": "8.15.0#1" }, + { + "name": "dbus", + "version": "1.16.2#1" + }, { "name": "dirent", "version": "1.25#0" @@ -269,6 +282,10 @@ "name": "qtmultimedia", "version": "6.8.3#0" }, + { + "name": "sdl3", + "version": "3.2.20#0" + }, { "name": "simdutf", "version": "7.4.0#0"