From 95d061e4fca2f7903ac903a2426cb5ad30c737f7 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Wed, 29 Oct 2025 20:50:09 +0800 Subject: Use SDL as submodule. --- .github/workflows/ci.yml | 2 +- .gitmodules | 3 +++ CMakeLists.txt | 1 + include/cru/platform/gui/sdl/Window.h | 2 +- lib/SDL | 1 + src/platform/gui/sdl/CMakeLists.txt | 4 +--- src/platform/gui/sdl/Window.cpp | 2 +- 7 files changed, 9 insertions(+), 6 deletions(-) create mode 160000 lib/SDL diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 142b472f..62eb32c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,7 @@ jobs: run: | sudo apt update sudo apt install -y libpng-dev libcairo2-dev libpango1.0-dev libxcb1-dev libxcb-cursor-dev \ - libxkbcommon-dev libxcb-imdkit-dev libxkbcommon-x11-dev libsdl2-dev + libxkbcommon-dev libxcb-imdkit-dev libxkbcommon-x11-dev - name: Build run: | diff --git a/.gitmodules b/.gitmodules index d49fb062..3acf86e8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "lib/Catch2"] path = lib/Catch2 url = https://github.com/catchorg/Catch2.git +[submodule "lib/SDL"] + path = lib/SDL + url = https://github.com/libsdl-org/SDL.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 980ff1ff..a5315b73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ if (APPLE) endif() add_subdirectory(lib/Catch2) +add_subdirectory(lib/SDL) enable_testing() diff --git a/include/cru/platform/gui/sdl/Window.h b/include/cru/platform/gui/sdl/Window.h index 4eb0a11d..c818ecce 100644 --- a/include/cru/platform/gui/sdl/Window.h +++ b/include/cru/platform/gui/sdl/Window.h @@ -4,7 +4,7 @@ #include "../Window.h" #include "Base.h" -#include +#include #include #include diff --git a/lib/SDL b/lib/SDL new file mode 160000 index 00000000..cecf4b0d --- /dev/null +++ b/lib/SDL @@ -0,0 +1 @@ +Subproject commit cecf4b0d4e771fea01ecbd0594a948ee0f872fb5 diff --git a/src/platform/gui/sdl/CMakeLists.txt b/src/platform/gui/sdl/CMakeLists.txt index f4266622..7d95f681 100644 --- a/src/platform/gui/sdl/CMakeLists.txt +++ b/src/platform/gui/sdl/CMakeLists.txt @@ -1,10 +1,8 @@ -find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2) - add_library(CruPlatformGuiSdl UiApplication.cpp Window.cpp ) target_link_libraries(CruPlatformGuiSdl PUBLIC CruPlatformGui CruPlatformGraphicsCairo - SDL2::SDL2 + SDL3::SDL3 ) diff --git a/src/platform/gui/sdl/Window.cpp b/src/platform/gui/sdl/Window.cpp index 84cf0ad4..3737cae0 100644 --- a/src/platform/gui/sdl/Window.cpp +++ b/src/platform/gui/sdl/Window.cpp @@ -8,7 +8,7 @@ #include "cru/platform/gui/Window.h" #include "cru/platform/gui/sdl/UiApplication.h" -#include +#include #include #include #include -- cgit v1.2.3