Skip to content

Commit 7d11074

Browse files
committed
Override SDL's architecture detection
This makes the configure faster and stops it from spamming the CMake cache with SDL_CPU_xxx variables.
1 parent 5d9e0f6 commit 7d11074

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,18 @@ endif()
725725

726726
# SDL, required for all targets on win32 because of iconv and SDL_SetHint(SDL_TIMER_RESOLUTION, 0)
727727
if (BUILD_CLIENT OR WIN32)
728+
# Use our detected architecture instead of letting SDL do it again
729+
# Note that sdlcpu.cmake is only included on a random subset of platforms
730+
set(sdlvar_i686 SDL_CPU_X86)
731+
set(sdlvar_amd64 SDL_CPU_X64)
732+
set(sdlvar_armhf SDL_CPU_ARM32)
733+
set(sdlvar_arm64 SDL_CPU_ARM64)
734+
if (sdlvar_${ARCH})
735+
set(${sdlvar_${ARCH}} 1)
736+
else()
737+
message("Developer TODO: translate architecture ${ARCH} for SDL")
738+
endif()
739+
728740
find_package(SDL3 REQUIRED CONFIG)
729741

730742
if (WIN32)

0 commit comments

Comments
 (0)