From b02765c4c76af23ab4cc5a4367cc9a33e3e25ade Mon Sep 17 00:00:00 2001 From: LawrenceK Date: Tue, 18 Dec 2012 14:11:04 +0000 Subject: [PATCH] Add -march=i686 for 32 bit builds as otherwise defaults to i386 which does not supply one of the intrinsics. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 92d59b7d7..8c655a84e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,9 @@ endif() # Compiler-specific flags if(CMAKE_COMPILER_IS_GNUCC) + if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686") + endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") CHECK_C_COMPILER_FLAG (-Wno-unused-result Wno-unused-result) if(Wno-unused-result)