From 626dbbe0d79ef2f5c12cfe474bdd09971207bfd8 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 26 Sep 2025 11:51:29 -0400 Subject: [PATCH] Enhance CMake configuration for Abseil and SDL2 dependencies - Added new Abseil components: absl::str_format, absl::container_memory, absl::memory, and absl::utility to the CMake configuration for improved functionality. - Updated SDL2 configuration to use static targets when bundled and adjusted the handling of system SDL to ensure proper target usage across platforms. --- cmake/absl.cmake | 4 ++++ cmake/sdl2.cmake | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmake/absl.cmake b/cmake/absl.cmake index 397ab883..a384e0a6 100644 --- a/cmake/absl.cmake +++ b/cmake/absl.cmake @@ -18,6 +18,7 @@ set(ABSL_ENABLE_INSTALL ON) set( ABSL_TARGETS absl::strings + absl::str_format absl::flags absl::status absl::statusor @@ -39,4 +40,7 @@ set( absl::flags_program_name absl::flags_config absl::flags_reflection + absl::container_memory + absl::memory + absl::utility ) diff --git a/cmake/sdl2.cmake b/cmake/sdl2.cmake index 51aaa551..a364f753 100644 --- a/cmake/sdl2.cmake +++ b/cmake/sdl2.cmake @@ -1,15 +1,16 @@ # SDL2 if (UNIX OR MINGW) add_subdirectory(src/lib/SDL) + # When using bundled SDL, use the static target + set(SDL_TARGETS SDL2-static) else() find_package(SDL2) -endif() - -set(SDL_TARGETS SDL2::SDL2) - -if(WIN32 OR MINGW) + # When using system SDL, use the imported targets + set(SDL_TARGETS SDL2::SDL2) + if(WIN32) list(PREPEND SDL_TARGETS SDL2::SDL2main ws2_32) add_definitions("-DSDL_MAIN_HANDLED") + endif() endif() # libpng and ZLIB dependencies