Ver Fonte

Revert back the configuration for VS to use SSE2 instead of AVX.
At the moment this would only disable SDL from using SSE3 instruction set for their audio conversion functions.
Close #2238.

Yao Wei Tjong 姚伟忠 há 7 anos atrás
pai
commit
1420410edd

+ 1 - 1
CMake/Modules/CheckCompilerToolchain.cmake

@@ -171,7 +171,7 @@ if (MSVC)
     # On MSVC compiler, use the chosen CMake/VS generator to determine the ABI
     set (NATIVE_64BIT ${CMAKE_CL_64})
     # We only support one target arch when using MSVC for now and make certain assumptions as per documentation instead of querying the compiler
-    foreach (VAR X86 HAVE_MMX HAVE_SSE HAVE_SSE2 HAVE_SSE3 HAVE_SSE4 HAVE_AVX RTTI EXCEPTIONS IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE IS_TRIVIALLY_DESTRUCTIBLE IS_TRIVIALLY_COPY_ASSIGNABLE IS_TRIVIALLY_COPY_CONSTRUCTIBLE)
+    foreach (VAR X86 HAVE_MMX HAVE_SSE HAVE_SSE2 RTTI EXCEPTIONS IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE IS_TRIVIALLY_DESTRUCTIBLE IS_TRIVIALLY_COPY_ASSIGNABLE IS_TRIVIALLY_COPY_CONSTRUCTIBLE)
         set (${VAR} 1)
     endforeach ()
 else ()

+ 2 - 6
CMake/Modules/UrhoCommon.cmake

@@ -552,12 +552,8 @@ if (MSVC)
     set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_RUNTIME}")
     set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_RUNTIME} /fp:fast /Zi /GS- /D _SECURE_SCL=0")
     set (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
-    # Visual Studio 2012 onward enables the SSE2 by default, however, we set the flag to AVX so that we get the SSE3 support (required by SDL)
-    # We must set the flag to IA32 if user intention is to turn the SIMD off
-    if (URHO3D_SSE)
-        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:AVX")
-        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX")
-    else ()
+    # Visual Studio 2012 onward enables the SSE2 by default, however, we must set the flag to IA32 if user intention is to turn the SIMD off
+    if (NOT URHO3D_SSE)
         set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:IA32")
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:IA32")
     endif ()