Bladeren bron

Fix loongarch64 support

HAS_LSX/LASX is modified as HAVE_LSX/LASX.
yuanhecai 2 jaren geleden
bovenliggende
commit
50af65a7dd
1 gewijzigde bestanden met toevoegingen van 8 en 8 verwijderingen
  1. 8 8
      CMakeLists.txt

+ 8 - 8
CMakeLists.txt

@@ -823,33 +823,33 @@ if(SDL_ASSEMBLY)
     if(SDL_LSX)
       cmake_push_check_state()
       set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mlsx")
-      check_c_source_compiles([[
+      check_c_source_compiles("
           #ifndef __loongarch_sx
           #error Assembler CPP flag not enabled
           #endif
-        ]] CPU_HAS_LSX)
+          int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_LSX)
       check_include_file("lsxintrin.h" HAVE_LSXINTRIN_H)
       cmake_pop_check_state()
 
-      if(CPU_HAS_LSX AND HAVE_LSXINTRIN_H)
+      if(CPU_SUPPORTS_LSX AND HAVE_LSXINTRIN_H)
         target_compile_options(sdl-build-options INTERFACE "-mlsx")
-        set(HAS_LSX TRUE)
+        set(HAVE_LSX TRUE)
       endif()
     endif()
 
     if(SDL_LASX)
       cmake_push_check_state()
       set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mlasx")
-      check_c_source_compiles([[
+      check_c_source_compiles("
           #ifndef __loongarch_asx
           #error Assembler CPP flag not enabled
           #endif
-        ]] CPU_HAS_LASX)
+          int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_LASX)
       check_include_file("lasxintrin.h" HAVE_LASXINTRIN_H)
       cmake_pop_check_state()
-      if(CPU_HAS_LASX AND HAVE_LASXINTRIN_H)
+      if(CPU_SUPPORTS_LASX AND HAVE_LASXINTRIN_H)
         target_compile_options(sdl-build-options INTERFACE "-mlasx")
-        set(HAS_LASX TRUE)
+        set(HAVE_LASX TRUE)
       endif()
     endif()