cmake: simd detection clean-up for Apple multi-arch configs.
This commit is contained in:
@@ -80,6 +80,12 @@ include("${SDL3_SOURCE_DIR}/cmake/PreseedNokiaNGageCache.cmake")
|
|||||||
|
|
||||||
SDL_DetectCompiler()
|
SDL_DetectCompiler()
|
||||||
SDL_DetectTargetCPUArchitectures(SDL_CPUS)
|
SDL_DetectTargetCPUArchitectures(SDL_CPUS)
|
||||||
|
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||||
|
list(LENGTH CMAKE_OSX_ARCHITECTURES _num_arches)
|
||||||
|
if(_num_arches GREATER 1)
|
||||||
|
set(APPLE_MULTIARCH TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Increment this if there is an incompatible change - but if that happens,
|
# Increment this if there is an incompatible change - but if that happens,
|
||||||
# we should rename the library from SDL3 to SDL4, at which point this would
|
# we should rename the library from SDL3 to SDL4, at which point this would
|
||||||
|
|||||||
@@ -165,20 +165,19 @@ function(check_x86_source_compiles BODY VAR)
|
|||||||
if(ARGN)
|
if(ARGN)
|
||||||
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
|
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
|
||||||
endif()
|
endif()
|
||||||
if(APPLE AND DEFINED CMAKE_OSX_ARCHITECTURES)
|
if(APPLE_MULTIARCH AND (SDL_CPU_X86 OR SDL_CPU_X64))
|
||||||
set(test_conditional 1)
|
set(test_conditional 1)
|
||||||
else()
|
else()
|
||||||
set(test_conditional 0)
|
set(test_conditional 0)
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#if ${test_conditional}
|
#if ${test_conditional}
|
||||||
# include \"TargetConditionals.h\"
|
# if defined(__i386__) || defined(__x86_64__)
|
||||||
# if TARGET_CPU_X86 || TARGET_CPU_X86_64
|
|
||||||
# define test_enabled 1
|
# define test_enabled 1
|
||||||
# else
|
# else
|
||||||
# define test_enabled 0
|
# define test_enabled 0 /* feign success in Apple multi-arch configs */
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else /* test normally */
|
||||||
# define test_enabled 1
|
# define test_enabled 1
|
||||||
#endif
|
#endif
|
||||||
#if test_enabled
|
#if test_enabled
|
||||||
@@ -196,20 +195,19 @@ function(check_arm_source_compiles BODY VAR)
|
|||||||
if(ARGN)
|
if(ARGN)
|
||||||
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
|
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
|
||||||
endif()
|
endif()
|
||||||
if(APPLE AND DEFINED CMAKE_OSX_ARCHITECTURES)
|
if(APPLE_MULTIARCH AND (SDL_CPU_ARM32 OR SDL_CPU_ARM64))
|
||||||
set(test_conditional 1)
|
set(test_conditional 1)
|
||||||
else()
|
else()
|
||||||
set(test_conditional 0)
|
set(test_conditional 0)
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#if ${test_conditional}
|
#if ${test_conditional}
|
||||||
# include \"TargetConditionals.h\"
|
# if defined(__arm__) || defined(__aarch64__)
|
||||||
# if TARGET_CPU_ARM || TARGET_CPU_ARM64
|
|
||||||
# define test_enabled 1
|
# define test_enabled 1
|
||||||
# else
|
# else
|
||||||
# define test_enabled 0
|
# define test_enabled 0 /* feign success in Apple multi-arch configs */
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else /* test normally */
|
||||||
# define test_enabled 1
|
# define test_enabled 1
|
||||||
#endif
|
#endif
|
||||||
#if test_enabled
|
#if test_enabled
|
||||||
|
|||||||
Reference in New Issue
Block a user