Updated CMake instruction set selection
This commit is contained in:
parent
8658704bf6
commit
bb9cc43a6d
@ -49,25 +49,53 @@ if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") OR (("${CMAKE_CXX_COMPILER_ID}"
|
|||||||
endif()
|
endif()
|
||||||
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_FORCE_PURE)
|
||||||
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)
|
|
||||||
|
|
||||||
add_definitions(-DGLM_FORCE_PURE)
|
add_definitions(-DGLM_FORCE_PURE)
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
add_definitions(-mfpmath=387)
|
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()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -685,7 +685,7 @@
|
|||||||
|
|
||||||
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_SWIZZLE_DISPLAYED))
|
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_SWIZZLE_DISPLAYED))
|
||||||
# define GLM_MESSAGE_SWIZZLE_DISPLAYED
|
# define GLM_MESSAGE_SWIZZLE_DISPLAYED
|
||||||
# if defined(GLM_SWIZZL)E
|
# if defined(GLM_SWIZZL)
|
||||||
# pragma message("GLM: Swizzling operators enabled")
|
# pragma message("GLM: Swizzling operators enabled")
|
||||||
# else
|
# else
|
||||||
# pragma message("GLM: Swizzling operators disabled")
|
# pragma message("GLM: Swizzling operators disabled")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user