Ver código fonte

fix ARM64 linkage with Visual Studio >= 17.14 when SDL_LIBC is disabled

Reference issue:  https://github.com/libsdl-org/SDL/issues/13254

(cherry picked from commit 2fb6abb9ad27cd0948a47fd53ced0ab138d7d12a)
Ozkan Sezer 2 semanas atrás
pai
commit
73492c5570
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      CMakeLists.txt

+ 5 - 0
CMakeLists.txt

@@ -755,6 +755,11 @@ if(MSVC)
   if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64")
     list(APPEND EXTRA_LDFLAGS_BUILD "-CETCOMPAT")
   endif()
+
+  # for VS >= 17.14 targeting ARM64: inline the Interlocked funcs
+  if(MSVC_VERSION GREATER 1943 AND SDL_CPU_ARM64 AND NOT SDL_LIBC)
+    list(APPEND EXTRA_CFLAGS /forceInterlockedFunctions-)
+  endif()
 endif()
 
 if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")