Updated CMake instruction set selection
This commit is contained in:
@@ -49,25 +49,53 @@ if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") OR (("${CMAKE_CXX_COMPILER_ID}"
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#set(GLM_SIMD_INSTRUCTION_SET "" CACHE STRING "Instruction set. Possible values are SSE1, SSE2")
|
||||
option(GLM_TEST_ENABLE_SSE2 "Enable SSE2 optimizations" OFF)
|
||||
option(GLM_TEST_ENABLE_SSE3 "Enable SSE3 optimizations" OFF)
|
||||
option(GLM_TEST_ENABLE_AVX "Enable AVX optimizations" OFF)
|
||||
option(GLM_TEST_ENABLE_AVX2 "Enable AVX2 optimizations" OFF)
|
||||
option(GLM_TEST_FORCE_PURE "Force 'pure' instructions" OFF)
|
||||
|
||||
option(GLM_TEST_ENABLE_SIMD "Enable SIMD optimizations" OFF)
|
||||
if(GLM_TEST_ENABLE_SIMD)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-msse2)
|
||||
elseif(GLM_USE_INTEL)
|
||||
add_definitions(/QxAVX)
|
||||
elseif(MSVC10)
|
||||
add_definitions(/arch:AVX)
|
||||
elseif(MSVC)
|
||||
add_definitions(/arch:SSE2)
|
||||
endif()
|
||||
elseif(NOT GLM_TEST_ENABLE_SIMD)
|
||||
|
||||
if(GLM_TEST_FORCE_PURE)
|
||||
add_definitions(-DGLM_FORCE_PURE)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-mfpmath=387)
|
||||
elseif(MSVC)
|
||||
add_definitions(/arch:IA32)
|
||||
endif()
|
||||
elseif(GLM_TEST_ENABLE_AVX2)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-mavx2)
|
||||
elseif(GLM_USE_INTEL)
|
||||
add_definitions(/QxAVX2)
|
||||
elseif(MSVC)
|
||||
add_definitions(/arch:AVX2)
|
||||
endif()
|
||||
elseif(GLM_TEST_ENABLE_AVX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-mavx)
|
||||
elseif(GLM_USE_INTEL)
|
||||
add_definitions(/QxAVX)
|
||||
elseif(MSVC)
|
||||
add_definitions(/arch:AVX)
|
||||
endif()
|
||||
elseif(GLM_TEST_ENABLE_SSE3)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-msse3)
|
||||
elseif(GLM_USE_INTEL)
|
||||
add_definitions(/QxSSE3)
|
||||
elseif(MSVC)
|
||||
add_definitions(/arch:SSE3)
|
||||
endif()
|
||||
elseif(GLM_TEST_ENABLE_SSE2)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-msse2)
|
||||
elseif(GLM_USE_INTEL)
|
||||
add_definitions(/QxSSE2)
|
||||
elseif(MSVC)
|
||||
if(NOT CMAKE_CL_64)
|
||||
add_definitions(/arch:SSE2)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user