From 52feb172468a4b8eed0f04c77a7fabc4a41cab67 Mon Sep 17 00:00:00 2001 From: Joachim Schurig Date: Thu, 5 Oct 2023 12:16:03 +0200 Subject: [PATCH] no lax conv for clang recent versions of sse2neon.h (included through simd_utils) do not build using (apple) clang and -flax-vector-conversions. (apple) clang builds (other than gcc) do not need this option though, therefore do not add it if clang is used. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a8a25fe6..e1a9bc8b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,10 @@ if(USE_SIMD_UTILS) endif() if(MSVC) add_compile_options(/flax-vector-conversions) - else(MSVC) + elseif(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # clang has a different default behaviour than gcc or msvc for lax-vector-conversions + # and does not need the flag - it causes actually harm for some type casts - + # see https://github.com/DLTcollab/sse2neon/pull/614 add_compile_options(-flax-vector-conversions) endif(MSVC) endif(USE_SIMD_UTILS)