[x265] cmake: change default arch for 32bit GCC from -march=i686 to -march=pentium4 -mtune=generic

Mateusz mateuszb at poczta.onet.pl
Fri Apr 15 20:31:54 CEST 2016


# HG changeset patch
# User Ma0 <mateuszb at poczta.onet.pl>
# Date 1460743796 -7200
#      Fri Apr 15 20:09:56 2016 +0200
# Node ID 97557894ea10152cfa08b080b5e8b6e227b47bb3
# Parent  34a3d35c5f97c7ecf76bbb3311a9bbb66db0d695
cmake: change default arch for 32bit GCC from -march=i686 to 
-march=pentium4 -mtune=generic

If someone wants to compile for i686, please first
export CXXFLAGS="-march=i686"
and then compile.

diff -r 34a3d35c5f97 -r 97557894ea10 source/CMakeLists.txt
--- a/source/CMakeLists.txt    Tue Apr 12 19:34:49 2016 +0530
+++ b/source/CMakeLists.txt    Fri Apr 15 20:09:56 2016 +0200
@@ -181,7 +181,14 @@
              add_definitions(-march=native)
          endif()
      elseif(X86 AND NOT X64)
-        add_definitions(-march=i686)
+        string(FIND "${CMAKE_CXX_FLAGS}" "-march" marchPos)
+        if(marchPos LESS "0")
+            add_definitions(-march=pentium4)
+            string(FIND "${CMAKE_CXX_FLAGS}" "-mtune" mtunePos)
+            if(mtunePos LESS "0")
+                add_definitions(-mtune=generic)
+            endif()
+        endif()
      endif()
      if(ARM AND CROSS_COMPILE_ARM)
          set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm)


More information about the x265-devel mailing list