aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt97
1 files changed, 32 insertions, 65 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0dfc7fce..67369d78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -364,16 +364,11 @@ ELSE()
SET(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS}")
ENDIF()
-SET(SSE_SWITCH "")
SET(SSE2_SWITCH "")
SET(SSE3_SWITCH "")
SET(SSE4_1_SWITCH "")
SET(FPU_NEON_SWITCH "")
-CHECK_C_COMPILER_FLAG(-msse HAVE_MSSE_SWITCH)
-IF(HAVE_MSSE_SWITCH)
- SET(SSE_SWITCH "-msse")
-ENDIF()
CHECK_C_COMPILER_FLAG(-msse2 HAVE_MSSE2_SWITCH)
IF(HAVE_MSSE2_SWITCH)
SET(SSE2_SWITCH "-msse2")
@@ -393,9 +388,6 @@ ENDIF()
SET(FPMATH_SET "0")
IF(CMAKE_SIZEOF_VOID_P MATCHES "4")
- IF(SSE_SWITCH OR MSVC)
- OPTION(ALSOFT_ENABLE_SSE_CODEGEN "Enable SSE code generation instead of x87 for 32-bit targets." TRUE)
- ENDIF()
IF(SSE2_SWITCH OR MSVC)
OPTION(ALSOFT_ENABLE_SSE2_CODEGEN "Enable SSE2 code generation instead of x87 for 32-bit targets." TRUE)
ENDIF()
@@ -415,21 +407,6 @@ IF(CMAKE_SIZEOF_VOID_P MATCHES "4")
ENDIF()
ENDIF()
ENDIF()
- IF(ALSOFT_ENABLE_SSE_CODEGEN AND NOT FPMATH_SET)
- IF(SSE_SWITCH)
- CHECK_C_COMPILER_FLAG("${SSE_SWITCH} -mfpmath=sse" HAVE_MFPMATH_SSE)
- IF(HAVE_MFPMATH_SSE)
- SET(C_FLAGS ${C_FLAGS} ${SSE_SWITCH} -mfpmath=sse)
- SET(FPMATH_SET 1)
- ENDIF()
- ELSEIF(MSVC)
- CHECK_C_COMPILER_FLAG("/arch:SSE" HAVE_ARCH_SSE)
- IF(HAVE_ARCH_SSE)
- SET(C_FLAGS ${C_FLAGS} "/arch:SSE")
- SET(FPMATH_SET 1)
- ENDIF()
- ENDIF()
- ENDIF()
ENDIF()
@@ -746,60 +723,37 @@ SET(HAVE_SSE3 0)
SET(HAVE_SSE4_1 0)
SET(HAVE_NEON 0)
-SET(HAVE_ALSA 0)
-SET(HAVE_OSS 0)
-SET(HAVE_SOLARIS 0)
-SET(HAVE_SNDIO 0)
-SET(HAVE_QSA 0)
-SET(HAVE_DSOUND 0)
-SET(HAVE_WASAPI 0)
-SET(HAVE_WINMM 0)
-SET(HAVE_PORTAUDIO 0)
-SET(HAVE_PULSEAUDIO 0)
-SET(HAVE_COREAUDIO 0)
-SET(HAVE_OPENSL 0)
-SET(HAVE_WAVE 0)
-SET(HAVE_SDL2 0)
+CHECK_INCLUDE_FILE(xmmintrin.h HAVE_XMMINTRIN_H "${SSE2_SWITCH}")
+CHECK_INCLUDE_FILE(emmintrin.h HAVE_EMMINTRIN_H "${SSE2_SWITCH}")
+CHECK_INCLUDE_FILE(pmmintrin.h HAVE_PMMINTRIN_H "${SSE3_SWITCH}")
+CHECK_INCLUDE_FILE(smmintrin.h HAVE_SMMINTRIN_H "${SSE4_1_SWITCH}")
+CHECK_INCLUDE_FILE(arm_neon.h HAVE_ARM_NEON_H "${FPU_NEON_SWITCH}")
-# Check for SSE support
+# Check for SSE+SSE2 support
OPTION(ALSOFT_REQUIRE_SSE "Require SSE support" OFF)
-CHECK_INCLUDE_FILE(xmmintrin.h HAVE_XMMINTRIN_H "${SSE_SWITCH}")
-IF(HAVE_XMMINTRIN_H)
+OPTION(ALSOFT_REQUIRE_SSE2 "Require SSE2 support" OFF)
+IF(HAVE_XMMINTRIN_H AND HAVE_EMMINTRIN_H)
OPTION(ALSOFT_CPUEXT_SSE "Enable SSE support" ON)
- IF(ALSOFT_CPUEXT_SSE)
+ OPTION(ALSOFT_CPUEXT_SSE2 "Enable SSE2 support" ON)
+ IF(ALSOFT_CPUEXT_SSE AND ALSOFT_CPUEXT_SSE2)
SET(HAVE_SSE 1)
- SET(ALC_OBJS ${ALC_OBJS} Alc/mixer/mixer_sse.cpp)
- IF(SSE_SWITCH)
- SET_SOURCE_FILES_PROPERTIES(Alc/mixer/mixer_sse.cpp PROPERTIES
- COMPILE_FLAGS "${SSE_SWITCH}")
+ SET(HAVE_SSE2 1)
+ SET(ALC_OBJS ${ALC_OBJS} Alc/mixer/mixer_sse.cpp Alc/mixer/mixer_sse2.cpp)
+ IF(SSE2_SWITCH)
+ SET_SOURCE_FILES_PROPERTIES(Alc/mixer/mixer_sse.cpp Alc/mixer/mixer_sse2.cpp
+ PROPERTIES COMPILE_FLAGS "${SSE2_SWITCH}")
ENDIF()
- SET(CPU_EXTS "${CPU_EXTS}, SSE")
+ SET(CPU_EXTS "${CPU_EXTS}, SSE, SSE2")
ENDIF()
ENDIF()
IF(ALSOFT_REQUIRE_SSE AND NOT HAVE_SSE)
MESSAGE(FATAL_ERROR "Failed to enabled required SSE CPU extensions")
ENDIF()
-
-OPTION(ALSOFT_REQUIRE_SSE2 "Require SSE2 support" OFF)
-CHECK_INCLUDE_FILE(emmintrin.h HAVE_EMMINTRIN_H "${SSE2_SWITCH}")
-IF(HAVE_EMMINTRIN_H)
- OPTION(ALSOFT_CPUEXT_SSE2 "Enable SSE2 support" ON)
- IF(HAVE_SSE AND ALSOFT_CPUEXT_SSE2)
- SET(HAVE_SSE2 1)
- SET(ALC_OBJS ${ALC_OBJS} Alc/mixer/mixer_sse2.cpp)
- IF(SSE2_SWITCH)
- SET_SOURCE_FILES_PROPERTIES(Alc/mixer/mixer_sse2.cpp PROPERTIES
- COMPILE_FLAGS "${SSE2_SWITCH}")
- ENDIF()
- SET(CPU_EXTS "${CPU_EXTS}, SSE2")
- ENDIF()
-ENDIF()
IF(ALSOFT_REQUIRE_SSE2 AND NOT HAVE_SSE2)
MESSAGE(FATAL_ERROR "Failed to enable required SSE2 CPU extensions")
ENDIF()
OPTION(ALSOFT_REQUIRE_SSE3 "Require SSE3 support" OFF)
-CHECK_INCLUDE_FILE(pmmintrin.h HAVE_PMMINTRIN_H "${SSE3_SWITCH}")
IF(HAVE_EMMINTRIN_H)
OPTION(ALSOFT_CPUEXT_SSE3 "Enable SSE3 support" ON)
IF(HAVE_SSE2 AND ALSOFT_CPUEXT_SSE3)
@@ -817,10 +771,9 @@ IF(ALSOFT_REQUIRE_SSE3 AND NOT HAVE_SSE3)
ENDIF()
OPTION(ALSOFT_REQUIRE_SSE4_1 "Require SSE4.1 support" OFF)
-CHECK_INCLUDE_FILE(smmintrin.h HAVE_SMMINTRIN_H "${SSE4_1_SWITCH}")
IF(HAVE_SMMINTRIN_H)
OPTION(ALSOFT_CPUEXT_SSE4_1 "Enable SSE4.1 support" ON)
- IF(HAVE_SSE2 AND ALSOFT_CPUEXT_SSE4_1)
+ IF(HAVE_SSE3 AND ALSOFT_CPUEXT_SSE4_1)
SET(HAVE_SSE4_1 1)
SET(ALC_OBJS ${ALC_OBJS} Alc/mixer/mixer_sse41.cpp)
IF(SSE4_1_SWITCH)
@@ -836,7 +789,6 @@ ENDIF()
# Check for ARM Neon support
OPTION(ALSOFT_REQUIRE_NEON "Require ARM Neon support" OFF)
-CHECK_INCLUDE_FILE(arm_neon.h HAVE_ARM_NEON_H ${FPU_NEON_SWITCH})
IF(HAVE_ARM_NEON_H)
OPTION(ALSOFT_CPUEXT_NEON "Enable ARM Neon support" ON)
IF(ALSOFT_CPUEXT_NEON)
@@ -854,6 +806,21 @@ IF(ALSOFT_REQUIRE_NEON AND NOT HAVE_NEON)
ENDIF()
+SET(HAVE_ALSA 0)
+SET(HAVE_OSS 0)
+SET(HAVE_SOLARIS 0)
+SET(HAVE_SNDIO 0)
+SET(HAVE_QSA 0)
+SET(HAVE_DSOUND 0)
+SET(HAVE_WASAPI 0)
+SET(HAVE_WINMM 0)
+SET(HAVE_PORTAUDIO 0)
+SET(HAVE_PULSEAUDIO 0)
+SET(HAVE_COREAUDIO 0)
+SET(HAVE_OPENSL 0)
+SET(HAVE_WAVE 0)
+SET(HAVE_SDL2 0)
+
IF(WIN32 OR HAVE_DLFCN_H)
SET(IS_LINKED "")
MACRO(ADD_BACKEND_LIBS _LIBS)