|
1 | 1 | find_package(OpenGL QUIET)
|
2 | 2 |
|
3 |
| -if (CMAKE_SYSTEM_NAME MATCHES "Windows") |
4 |
| - find_package(SDL2 CONFIG REQUIRED) |
5 |
| -elseif (NOT CMAKE_SYSTEM_NAME STREQUAL "Android") |
6 |
| - find_package(SDL2 REQUIRED) |
7 |
| -endif() |
8 |
| - |
9 | 3 | ################################################################################
|
10 |
| -# Find/download SDL2 for Android |
| 4 | +# Find/download SDL3 |
11 | 5 | ################################################################################
|
12 |
| -if (CMAKE_SYSTEM_NAME STREQUAL "Android") |
13 |
| - find_package(SDL2 QUIET) |
14 |
| - if (NOT ${SDL2_FOUND}) |
15 |
| - include(FetchContent) |
16 |
| - FetchContent_Declare( |
17 |
| - SDL2 |
18 |
| - GIT_REPOSITORY https://github.com/libsdl-org/SDL.git |
19 |
| - GIT_TAG release-2.28.1 |
20 |
| - ) |
21 |
| - message("SDL2 not found. Downloading now...") |
22 |
| - FetchContent_MakeAvailable(SDL2) |
23 |
| - message("SDL2 downloaded to " ${FETCHCONTENT_BASE_DIR}/sdl2-src) |
24 |
| - endif() |
| 6 | +find_package(SDL3 QUIET) |
| 7 | +if (NOT ${SDL3_FOUND}) |
| 8 | + include(FetchContent) |
| 9 | + FetchContent_Declare( |
| 10 | + SDL3 |
| 11 | + https://github.com/briaguya-ai/SDL.git |
| 12 | + GIT_TAG 2b09ae46442b659c4663a0dec9eb94ef3264abf5 |
| 13 | + ) |
| 14 | + message("SDL3 not found. Downloading now...") |
| 15 | + FetchContent_MakeAvailable(SDL3) |
| 16 | + message("SDL3 downloaded to " ${FETCHCONTENT_BASE_DIR}/sdl3-src) |
25 | 17 | endif()
|
26 | 18 |
|
| 19 | + |
27 | 20 | #=================== DrLibs ===================
|
28 | 21 |
|
29 | 22 | set(DRLIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dr_libs)
|
@@ -93,19 +86,19 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
|
93 | 86 | )
|
94 | 87 | endif()
|
95 | 88 |
|
96 |
| -target_include_directories(ImGui PUBLIC ${IMGUI_DIR} ${IMGUI_DIR}/backends PRIVATE ${SDL2_INCLUDE_DIRS}) |
| 89 | +target_include_directories(ImGui PUBLIC ${IMGUI_DIR} ${IMGUI_DIR}/backends PRIVATE ${SDL3_INCLUDE_DIRS}) |
97 | 90 |
|
98 | 91 | if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
99 | 92 | target_include_directories(ImGui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/metal-cpp)
|
100 | 93 | target_compile_definitions(ImGui PUBLIC IMGUI_IMPL_METAL_CPP)
|
101 | 94 | endif()
|
102 | 95 |
|
103 | 96 | if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
104 |
| - target_link_libraries(ImGui PUBLIC SDL2::SDL2 SDL2::SDL2main) |
| 97 | + target_link_libraries(ImGui PUBLIC SDL3::SDL3 SDL3::SDL3main) |
105 | 98 | elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
|
106 |
| - target_link_libraries(ImGui PUBLIC SDL2::SDL2-static) |
| 99 | + target_link_libraries(ImGui PUBLIC SDL3::SDL3-static) |
107 | 100 | else()
|
108 |
| - target_link_libraries(ImGui PUBLIC SDL2::SDL2) |
| 101 | + target_link_libraries(ImGui PUBLIC SDL3::SDL3) |
109 | 102 | endif()
|
110 | 103 |
|
111 | 104 | if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
0 commit comments