-
Notifications
You must be signed in to change notification settings - Fork 388
refactor!: SDL3 migration #8336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
AzmodiusX
wants to merge
13
commits into
cataclysmbn:main
Choose a base branch
from
AzmodiusX:SLD3-Migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,985
−3,020
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
877eb12
Init
AzmodiusX e389424
Migration
AzmodiusX f2cbda6
Sound
AzmodiusX 5034507
Finalization of base migration
AzmodiusX 891ecb5
style(autofix.ci): automated formatting
autofix-ci[bot] a60210b
Update CMakeLists.txt
AzmodiusX 8fa63d9
Workflows
AzmodiusX 7a6806b
Update msvc-full-features-cmake.yml
AzmodiusX 26153f9
Workflows 2
AzmodiusX a97ba80
CMakeLists Config Required
AzmodiusX 2c1913b
add support for android builds
WishDuck 5c90959
cleanup
WishDuck b625265
dont let me inflict the tree
WishDuck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| #.rst: | ||
| # FindSDL3 | ||
| # ------- | ||
| # | ||
| # Locate SDL3 library (fallback module — SDL3Config.cmake is preferred) | ||
| # | ||
| # This module defines: | ||
| # | ||
| # SDL3_LIBRARY, the name of the library to link against | ||
| # SDL3_FOUND, if false, do not try to link to SDL3 | ||
| # SDL3_INCLUDE_DIR, where to find SDL3/SDL.h | ||
| # SDL3_VERSION_STRING, human-readable string containing the version of SDL3 | ||
|
|
||
| find_path(SDL3_INCLUDE_DIR SDL3/SDL.h | ||
| HINTS | ||
| ENV SDL3DIR | ||
| ${CMAKE_SOURCE_DIR}/dep/ | ||
| PATH_SUFFIXES SDL3 | ||
| include/SDL3 include | ||
| ) | ||
|
|
||
| if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
| set(VC_LIB_PATH_SUFFIX lib/x64) | ||
| else() | ||
| set(VC_LIB_PATH_SUFFIX lib/x86) | ||
| endif() | ||
|
|
||
| find_library(SDL3_LIBRARY_TEMP | ||
| NAMES SDL3 | ||
| HINTS | ||
| ENV SDL3DIR | ||
| ${CMAKE_SOURCE_DIR}/dep/ | ||
| PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} | ||
| ) | ||
|
|
||
| if(NOT SDL3_BUILDING_LIBRARY) | ||
| if(NOT SDL3_INCLUDE_DIR MATCHES ".framework") | ||
| find_library(SDL3MAIN_LIBRARY | ||
| NAMES SDL3main | ||
| HINTS | ||
| ENV SDL3DIR | ||
| ${CMAKE_SOURCE_DIR}/dep/ | ||
| PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} | ||
| ) | ||
| endif() | ||
| endif() | ||
|
|
||
| if(NOT APPLE) | ||
| find_package(Threads) | ||
| endif() | ||
|
|
||
| if(SDL3_LIBRARY_TEMP) | ||
| if(SDL3MAIN_LIBRARY AND NOT SDL3_BUILDING_LIBRARY) | ||
| list(FIND SDL3_LIBRARY_TEMP "${SDL3MAIN_LIBRARY}" _SDL3_MAIN_INDEX) | ||
| if(_SDL3_MAIN_INDEX EQUAL -1) | ||
| set(SDL3_LIBRARY_TEMP "${SDL3MAIN_LIBRARY}" ${SDL3_LIBRARY_TEMP}) | ||
| endif() | ||
| unset(_SDL3_MAIN_INDEX) | ||
| endif() | ||
|
|
||
| if(APPLE) | ||
| set(SDL3_LIBRARY_TEMP ${SDL3_LIBRARY_TEMP} "-framework Cocoa") | ||
| endif() | ||
|
|
||
| if(NOT APPLE) | ||
| set(SDL3_LIBRARY_TEMP ${SDL3_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) | ||
| endif() | ||
|
|
||
| set(SDL3_LIBRARY ${SDL3_LIBRARY_TEMP} CACHE STRING "Where the SDL3 Library can be found") | ||
| set(SDL3_LIBRARY_TEMP "${SDL3_LIBRARY_TEMP}" CACHE INTERNAL "") | ||
| endif() | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
|
|
||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL3 | ||
| REQUIRED_VARS SDL3_LIBRARY SDL3_INCLUDE_DIR | ||
| VERSION_VAR SDL3_VERSION_STRING) | ||
|
|
||
| if(SDL3_FOUND AND NOT TARGET SDL3::SDL3) | ||
| if(NOT DYNAMIC_LINKING) | ||
| add_library(SDL3::SDL3-static STATIC IMPORTED) | ||
| set_target_properties(SDL3::SDL3-static PROPERTIES | ||
| IMPORTED_LOCATION ${SDL3_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${SDL3_INCLUDE_DIR} | ||
| ) | ||
| else() | ||
| add_library(SDL3::SDL3 UNKNOWN IMPORTED) | ||
| set_target_properties(SDL3::SDL3 PROPERTIES | ||
| IMPORTED_LOCATION ${SDL3_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${SDL3_INCLUDE_DIR} | ||
| ) | ||
| endif() | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| #.rst: | ||
| # FindSDL3_image | ||
| # ------------- | ||
| # | ||
| # Locate SDL3_image library (fallback module — SDL3_imageConfig.cmake is preferred) | ||
| # | ||
| # This module defines: | ||
| # | ||
| # SDL3_IMAGE_LIBRARIES, the name of the library to link against | ||
| # SDL3_IMAGE_INCLUDE_DIRS, where to find the headers | ||
| # SDL3_IMAGE_FOUND, if false, do not try to link against | ||
| # SDL3_IMAGE_VERSION_STRING - human-readable string containing the version of SDL3_image | ||
|
|
||
| find_path(SDL3_IMAGE_INCLUDE_DIR SDL3/SDL_image.h | ||
| HINTS | ||
| ENV SDL3IMAGEDIR | ||
| ENV SDL3DIR | ||
| ${CMAKE_SOURCE_DIR}/dep/ | ||
| PATH_SUFFIXES SDL3 | ||
| include/SDL3 include | ||
| ) | ||
|
|
||
| if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
| set(VC_LIB_PATH_SUFFIX lib/x64) | ||
| else() | ||
| set(VC_LIB_PATH_SUFFIX lib/x86) | ||
| endif() | ||
|
|
||
| find_library(SDL3_IMAGE_LIBRARY | ||
| NAMES SDL3_image | ||
| HINTS | ||
| ENV SDL3IMAGEDIR | ||
| ENV SDL3DIR | ||
| ${CMAKE_SOURCE_DIR}/dep/ | ||
| PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} | ||
| ) | ||
|
|
||
| set(SDL3_IMAGE_LIBRARIES ${SDL3_IMAGE_LIBRARY}) | ||
| set(SDL3_IMAGE_INCLUDE_DIRS ${SDL3_IMAGE_INCLUDE_DIR}) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
|
|
||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL3_image | ||
| REQUIRED_VARS SDL3_IMAGE_LIBRARIES SDL3_IMAGE_INCLUDE_DIRS | ||
| VERSION_VAR SDL3_IMAGE_VERSION_STRING) | ||
|
|
||
| mark_as_advanced(SDL3_IMAGE_LIBRARY SDL3_IMAGE_INCLUDE_DIR) | ||
|
|
||
| if(NOT DYNAMIC_LINKING AND PKG_CONFIG_FOUND) | ||
| if (NOT TARGET SDL3_image::SDL3_image-static) | ||
| add_library(SDL3_image::SDL3_image-static STATIC IMPORTED) | ||
| set_property(TARGET SDL3_image::SDL3_image-static | ||
| PROPERTY IMPORTED_LOCATION ${SDL3_IMAGE_LIBRARY} | ||
| ) | ||
| endif() | ||
| message(STATUS "Searching for SDL3_image deps libraries --") | ||
| find_package(JPEG REQUIRED) | ||
| find_package(PNG REQUIRED) | ||
| find_package(TIFF REQUIRED) | ||
| find_library(JBIG jbig REQUIRED) | ||
| find_package(LibLZMA REQUIRED) | ||
| target_link_libraries(SDL3_image::SDL3_image-static INTERFACE | ||
| JPEG::JPEG | ||
| PNG::PNG | ||
| TIFF::TIFF | ||
| ${JBIG} | ||
| LibLZMA::LibLZMA | ||
| ${ZSTD} | ||
| ) | ||
| pkg_check_modules(WEBP REQUIRED IMPORTED_TARGET libwebp) | ||
| pkg_check_modules(ZIP REQUIRED IMPORTED_TARGET libzip) | ||
| pkg_check_modules(ZSTD REQUIRED IMPORTED_TARGET libzstd) | ||
| pkg_check_modules(DEFLATE REQUIRED IMPORTED_TARGET libdeflate) | ||
| target_link_libraries(SDL3_image::SDL3_image-static INTERFACE | ||
| PkgConfig::WEBP | ||
| PkgConfig::ZIP | ||
| PkgConfig::ZSTD | ||
| PkgConfig::DEFLATE | ||
| ) | ||
| elseif(NOT TARGET SDL3_image::SDL3_image) | ||
| add_library(SDL3_image::SDL3_image UNKNOWN IMPORTED) | ||
| set_target_properties(SDL3_image::SDL3_image PROPERTIES | ||
| IMPORTED_LOCATION ${SDL3_IMAGE_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${SDL3_IMAGE_INCLUDE_DIRS} | ||
| ) | ||
| target_link_libraries(SDL3_image::SDL3_image INTERFACE | ||
| z | ||
| ) | ||
| endif() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libsdl3-mixer-dev does not exist as an ubuntu package, the rest of the sdl3 packages are only available currently on ubuntu 25.04 or newer (and this workflow uses ubuntu 24.04)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is known, unfortunately we're gonna have to wait for a number of reasons.
I'm marking this as a draft for now. MacOS is similarly effected. We'd have to compile ourselves to skip the wait.
Hopefully won't be too long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if SDL3 requires a newer version of Ubuntu, I assume we'll have to change the required Ubuntu version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stable SDL3_Mixer came out last week, so its not available on stable distro packages yet.
I don't think the runner is going to support it until 26.04 LTS (ubuntu-latest runner image is still on 24.04)
Alternatively, we'll have to CMake FetchContent / Git Submodule SDL, as to not depend on distro packaging