From 2be54c9759a0cd80e4738b2a711a3a198350e6c9 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 23 Nov 2016 23:39:51 +0100 Subject: [PATCH] Fixed SIMD instruction set selection with Clang --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea4300cf..0cc6a2a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)