]> granicus.if.org Git - libjpeg-turbo/commitdiff
Build: Use -maltivec when testing AltiVec support
authorDRC <information@libjpeg-turbo.org>
Fri, 1 Sep 2017 13:52:21 +0000 (13:52 +0000)
committerDRC <information@libjpeg-turbo.org>
Fri, 1 Sep 2017 13:55:33 +0000 (08:55 -0500)
Doesn't seem to be necessary with recent Linux/GCC configurations, but
it is definitely necessary with OS X.

simd/CMakeLists.txt

index 252d23820b67afb5c076c22275ea6a71df7fda6e..3976a58ea9e0f34539375320a9f6cce5c0d543aa 100755 (executable)
@@ -284,6 +284,8 @@ endif()
 
 elseif(CPU_TYPE STREQUAL "powerpc")
 
+set(CMAKE_REQUIRED_FLAGS -maltivec)
+
 check_c_source_compiles("
   #include <altivec.h>
   int main(void) {
@@ -291,6 +293,8 @@ check_c_source_compiles("
     return vi[0];
   }" HAVE_ALTIVEC)
 
+unset(CMAKE_REQUIRED_FLAGS)
+
 if(NOT HAVE_ALTIVEC)
   simd_fail("SIMD extensions not available for this CPU (PowerPC SPE)")
   return()