build: changed detection for i686/x86_64

Fixes compilation/feature detection on arm.
This commit is contained in:
Bernhard Miklautz 2013-01-25 14:27:47 +01:00
parent 8db12370b0
commit 2dee5a1517
1 changed files with 4 additions and 2 deletions

View File

@ -98,8 +98,10 @@ endif()
# Compiler-specific flags
if(CMAKE_COMPILER_IS_GNUCC)
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT ANDROID)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "i686")
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
endif()
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
CHECK_C_COMPILER_FLAG (-Wno-unused-result Wno-unused-result)