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
path: root/CMake
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-04 22:40:59 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-04 22:40:59 +0400
commit6c0f3d052e1e41089a5887d38529b659b2792dce (patch)
treed269bb30353c5f45631ea181a9e918ad6cd090c3 /CMake
parenteffefdc9fae07aa59fcff732d84a8b3c206f7c9f (diff)
Detect SSE building support with cmake, and moved setting the defines
out of the render mode cmake file into the main one. Should fix PPC compile, and hopefully not break others.
Diffstat (limited to '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)
+