Look for /arch:SSE with MSVC for SSE
authorChris Robinson <chris.kcat@gmail.com>
Mon, 24 Dec 2012 13:26:33 +0000 (24 05:26 -0800)
committerChris Robinson <chris.kcat@gmail.com>
Mon, 24 Dec 2012 13:26:33 +0000 (24 05:26 -0800)
CMakeLists.txt

index 94f7c84..5d00543 100644 (file)
@@ -239,9 +239,17 @@ ELSE()
 ENDIF()
 
 SET(SSE_SWITCH "")
-CHECK_C_COMPILER_FLAG(-msse HAVE_MSSE_SWITCH)
-IF(HAVE_MSSE_SWITCH)
-    SET(SSE_SWITCH "-msse")
+IF(MSVC)
+    CHECK_C_COMPILER_FLAG(/arch:SSE HAVE_ARCHSSE_SWITCH)
+    IF(HAVE_ARCHSSE_SWITCH)
+        SET(SSE_SWITCH "/arch:SSE")
+    ENDIF()
+ENDIF()
+IF(NOT SSE_SWITCH)
+    CHECK_C_COMPILER_FLAG(-msse HAVE_MSSE_SWITCH)
+    IF(HAVE_MSSE_SWITCH)
+        SET(SSE_SWITCH "-msse")
+    ENDIF()
 ENDIF()
 
 CHECK_C_SOURCE_COMPILES("int foo(const char *str, ...) __attribute__((format(printf, 1, 2)));