Fixed SIMD instruction set selection with Clang

This commit is contained in:
Christophe Riccio 2016-11-23 23:39:51 +01:00
parent 74378ce1b9
commit 4ba6ef9046

View File

@ -109,7 +109,7 @@ if(GLM_TEST_FORCE_PURE)
endif()
message(STATUS "GLM: No SIMD instruction set")
elseif(GLM_TEST_ENABLE_SIMD_AVX2)
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
add_definitions(-mavx2)
elseif(GLM_USE_INTEL)
add_definitions(/QxAVX2)
@ -118,7 +118,7 @@ elseif(GLM_TEST_ENABLE_SIMD_AVX2)
endif()
message(STATUS "GLM: AVX2 instruction set")
elseif(GLM_TEST_ENABLE_SIMD_AVX)
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
add_definitions(-mavx)
elseif(GLM_USE_INTEL)
add_definitions(/QxAVX)
@ -127,7 +127,7 @@ elseif(GLM_TEST_ENABLE_SIMD_AVX)
endif()
message(STATUS "GLM: AVX instruction set")
elseif(GLM_TEST_ENABLE_SIMD_SSE3)
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
add_definitions(-msse3)
elseif(GLM_USE_INTEL)
add_definitions(/QxSSE3)
@ -136,7 +136,7 @@ elseif(GLM_TEST_ENABLE_SIMD_SSE3)
endif()
message(STATUS "GLM: SSE3 instruction set")
elseif(GLM_TEST_ENABLE_SIMD_SSE2)
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
add_definitions(-msse2)
elseif(GLM_USE_INTEL)
add_definitions(/QxSSE2)