[Bf-blender-cvs] [4b8430a] master: CMake: Add a flag to explicitly disable SSE/SSE2 intrinsics

Sergey Sharybin noreply at git.blender.org
Wed Oct 15 10:55:33 CEST 2014


Commit: 4b8430ae8aaab4374310e2f9a91aa253ec2f4ab2
Author: Sergey Sharybin
Date:   Wed Oct 15 14:53:12 2014 +0600
Branches: master
https://developer.blender.org/rB4b8430ae8aaab4374310e2f9a91aa253ec2f4ab2

CMake: Add a flag to explicitly disable SSE/SSE2 intrinsics

The flag is called WITH_CPU_SSE, it is ON by default so no one should
be affected by the change really.

This should hopefully fix https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763755

===================================================================

M	CMakeLists.txt
M	build_files/cmake/macros.cmake

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63dae89..91a8a04 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -273,6 +273,8 @@ option(WITH_PYTHON_INSTALL       "Copy system python into the blender install fo
 option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder"  ON)
 set(PYTHON_NUMPY_PATH            "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
 mark_as_advanced(PYTHON_NUMPY_PATH)
+option(WITH_CPU_SSE              "Enable SIMD instruction if they're detected on the host machine" ON)
+mark_as_advanced(WITH_CPU_SSE)
 
 if(UNIX AND NOT APPLE)
 	option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
@@ -568,7 +570,13 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS)
 	set(WITH_GHOST_XDND    OFF)
 endif()
 
-TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
+if(WITH_CPU_SSE)
+	TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
+else()
+	message(STATUS "SSE and SSE2 optimizations are DISABLED!")
+	set(COMPILER_SSE_FLAG)
+	set(COMPILER_SSE2_FLAG)
+endif()
 
 TEST_STDBOOL_SUPPORT()
 if(HAVE_STDBOOL_H)
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index b42e62e..70109cb 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -722,6 +722,8 @@ macro(TEST_SSE_SUPPORT
 endmacro()
 
 macro(TEST_STDBOOL_SUPPORT)
+	include(CheckCSourceRuns)
+
 	# This program will compile correctly if and only if
 	# this C compiler supports C99 stdbool.
 	check_c_source_runs("




More information about the Bf-blender-cvs mailing list