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:
authorCampbell Barton <ideasman42@gmail.com>2011-10-01 22:29:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-01 22:29:40 +0400
commit622e8ee363333dee5a80564ca1d13cbbbb6de3cb (patch)
treea75a8e319396c3c6c74ffc19cf0669ae5876f280 /build_files
parent9a88524f681d62cee51dfbc3186d59b4b0712a05 (diff)
cmake: sse flags were being defined in 2 different places
Diffstat (limited to 'build_files')
-rw-r--r--build_files/cmake/macros.cmake24
1 files changed, 18 insertions, 6 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 709779dc3eb..52e48a0c1ca 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -325,18 +325,30 @@ macro(setup_liblinks
endif()
endmacro()
-macro(TEST_SSE_SUPPORT)
+macro(TEST_SSE_SUPPORT
+ _sse_flags
+ _sse2_flags)
+
include(CheckCSourceRuns)
# message(STATUS "Detecting SSE support")
- if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_REQUIRED_FLAGS "-msse -msse2")
+ if(CMAKE_COMPILER_IS_GNUCC)
+ set(${_sse_flags} "-msse")
+ set(${_sse2_flags} "-msse2")
elseif(MSVC)
- set(CMAKE_REQUIRED_FLAGS "/arch:SSE2") # TODO, SSE 1 ?
+ set(${_sse_flags} "/arch:SSE")
+ set(${_sse2_flags} "/arch:SSE2")
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
- set(CMAKE_REQUIRED_FLAGS "-xSSE2")
+ set(${_sse_flags}) # icc only has sse2
+ set(${_sse2_flags} "-xSSE2")
else()
- message(STATUS "Compiler: '${CMAKE_C_COMPILER_ID}' has no SSE flags defiend for it!")
+ message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known")
+ set(_sse_flags)
+ set(_sse2_flags)
+ endif()
+
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_REQUIRED_FLAGS ${_sse_flags} ${_sse2_flags})
endif()
if(NOT DEFINED ${SUPPORT_SSE_BUILD})