aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-08-15 01:46:42 -0700
committerChris Robinson <[email protected]>2012-08-15 01:46:42 -0700
commitc3f387da70e5072f024f19cffc88621c25e8eff3 (patch)
tree76923eb413905908b02e3b8363637923d4540a2e
parent6ebeb3b4f76ad58b92d882e9cca762a54a85294d (diff)
Check for and use the -msse switch when dealing with SSE intrinsics
-rw-r--r--CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d9eb0826..fdee264e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -221,6 +221,12 @@ ELSE()
SET(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS}")
ENDIF()
+SET(SSE_SWITCH "")
+CHECK_C_COMPILER_FLAG(-msse HAVE_MSSE_SWITCH)
+IF(HAVE_MSSE_SWITCH)
+ SET(SSE_SWITCH "-msse")
+ENDIF()
+
CHECK_C_SOURCE_COMPILES("int foo(const char *str, ...) __attribute__((format(printf, 1, 2)));
int main() {return 0;}" HAVE_GCC_FORMAT)
@@ -441,10 +447,14 @@ SET(HAVE_NEON 0)
# Check for SSE support
IF(SSE)
- CHECK_INCLUDE_FILE(xmmintrin.h HAVE_XMMINTRIN_H)
+ CHECK_INCLUDE_FILE(xmmintrin.h HAVE_XMMINTRIN_H "${SSE_SWITCH}")
IF(HAVE_XMMINTRIN_H)
SET(HAVE_SSE 1)
SET(ALC_OBJS ${ALC_OBJS} Alc/mixer_sse.c)
+ IF(SSE_SWITCH)
+ SET_SOURCE_FILES_PROPERTIES(Alc/mixer_sse.c PROPERTIES
+ COMPILE_FLAGS "${SSE_SWITCH}")
+ ENDIF()
SET(CPU_EXTS "${CPU_EXTS}, SSE")
ENDIF()
ENDIF()