Current status of SDL.

This commit is contained in:
BadQuanta
2026-05-13 19:48:22 +00:00
parent 28e9c4ba18
commit 15bb051619
24 changed files with 1806 additions and 360 deletions
+36
View File
@@ -0,0 +1,36 @@
# Bundled SDL3 static library targets
# This file defines SDL3::SDL3 as an IMPORTED STATIC target pointing to the bundled
# SDL3 static library. This allows consumers of hdk-sdl to link against the bundled
# SDL3 without requiring system SDL3 to be installed.
# Compute the install prefix from this file's location
get_filename_component(_sdl3_install_prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_var}=${_file} referenced by hdk-sdlBundledSDL3Targets does not exist!")
endif()
endmacro()
# Validate the bundled SDL3 static library
set_and_check(_sdl3_lib_path "${_sdl3_install_prefix}/lib/cmake/hdk-sdl/sdl3-static/libSDL3.a")
# Define SDL3::SDL3 as IMPORTED STATIC target
if(NOT TARGET SDL3::SDL3)
add_library(SDL3::SDL3 STATIC IMPORTED GLOBAL)
set_target_properties(SDL3::SDL3 PROPERTIES
IMPORTED_LOCATION "${_sdl3_lib_path}"
VERSION "3.4.8"
)
# SDL3 is a static library; link dependencies would go here if needed
# For now, SDL3 is self-contained in the .a file
endif()
# Optionally define SDL3::SDL3-static as an alias for clarity
if(NOT TARGET SDL3::SDL3-static)
add_library(SDL3::SDL3-static ALIAS SDL3::SDL3)
endif()
unset(_sdl3_install_prefix)
unset(_sdl3_lib_path)