Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CMake/macros.cmake')
-rw-r--r--CMake/macros.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/CMake/macros.cmake b/CMake/macros.cmake
index 914547e168e..17662c5c447 100644
--- a/CMake/macros.cmake
+++ b/CMake/macros.cmake
@@ -181,3 +181,20 @@ MACRO(SETUP_LIBLINKS
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
ENDIF(WIN32)
ENDMACRO(SETUP_LIBLINKS)
+
+MACRO(TEST_SSE_SUPPORT)
+ INCLUDE(CHECKCXXSOURCECOMPILES)
+
+ MESSAGE(STATUS "Detecting SSE support")
+ IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ SET(CMAKE_REQUIRED_FLAGS "-msse -msse2")
+ ELSEIF(MSVC)
+ SET(CMAKE_REQUIRED_FLAGS "/arch:SSE2")
+ ENDIF()
+
+ CHECK_CXX_SOURCE_COMPILES("
+ #include <xmmintrin.h>
+ int main() { __m128 v = _mm_setzero_ps(); return 0; }"
+ SUPPORT_SSE_BUILD)
+ENDMACRO(TEST_SSE_SUPPORT)
+