summaryrefslogtreecommitdiff
path: root/gr-dtv
diff options
context:
space:
mode:
authorRon Economos <w6rz@comcast.net>2018-12-25 18:26:03 -0800
committerMartin Braun <martin.braun@ettus.com>2019-01-04 10:15:12 -0800
commit83c0b7c0651a1959ac118c67154fce50541755df (patch)
treedcf483f0f17bc2b4debba58a8bc7072f7c7f749d /gr-dtv
parent8c3cd093743b27e7ae77b6a115e88fc28174efea (diff)
dtv: Make SSE2 check clang compatible on ARM
CMake will fail to properly run check_c_compiler_flag() on ARM when checking for -msse2; it will always pass, and subsequent builds will fail. Trying to compile actual code during CMake is a more reliable way to see if SSE2 is actually available.
Diffstat (limited to 'gr-dtv')
-rw-r--r--gr-dtv/lib/CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/gr-dtv/lib/CMakeLists.txt b/gr-dtv/lib/CMakeLists.txt
index 9efbd7f9b0..61abd10dc2 100644
--- a/gr-dtv/lib/CMakeLists.txt
+++ b/gr-dtv/lib/CMakeLists.txt
@@ -117,7 +117,12 @@ if (MSVC)
CHECK_C_COMPILER_FLAG ("/arch:SSE2" SSE2_SUPPORTED)
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
else ()
- CHECK_C_COMPILER_FLAG ("-msse2" SSE2_SUPPORTED)
+ # The "correct" way to test this would be to run
+ # check_c_compiler_flag("-msse2")
+ # ...but that's not reliable, in particular, on Clang and ARM, it will
+ # return TRUE when it shouldn't. Hence, we compile this snippet
+ # manually.
+ check_c_source_compiles("#include <emmintrin.h>\nint main(){__m128i m0, m1, m2; m0 = _mm_add_epi8(m1, m2);}" SSE2_SUPPORTED)
endif(MSVC)
if(SSE2_SUPPORTED)