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
This commit is contained in:
Sergey Sharybin 2014-10-15 14:53:12 +06:00
parent d79f679896
commit 4b8430ae8a
2 changed files with 11 additions and 1 deletions

View File

@ -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)

View File

@ -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("