From e8358821b70a5569903dc34c251f74277994f11a Mon Sep 17 00:00:00 2001 From: Dan Stowell Date: Sun, 17 Jan 2016 22:56:41 +0000 Subject: [PATCH 1/2] compile fix: don't use x86 SSE compile flags on ARM --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6b1f47b9a..af18944ffa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,11 +52,13 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG) add_definitions(-fvisibility=hidden) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2") - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -msse -msse2") - if(NOT APPLE AND NOT CMAKE_COMPILER_IS_CLANG) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse") + IF(NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -msse -msse2") + if(NOT APPLE AND NOT CMAKE_COMPILER_IS_CLANG) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse") + endif() endif() if(NATIVE) add_definitions(-march=native) From 05aecbf1b8a7c6cc138cdbb4c895b8c1360ca30e Mon Sep 17 00:00:00 2001 From: Dan Stowell Date: Sun, 17 Jan 2016 23:16:50 +0000 Subject: [PATCH 2/2] More SSE ARM fixes --- source/StkInst/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/StkInst/CMakeLists.txt b/source/StkInst/CMakeLists.txt index e032074c13..351ed46060 100644 --- a/source/StkInst/CMakeLists.txt +++ b/source/StkInst/CMakeLists.txt @@ -39,9 +39,11 @@ if(APPLE OR WIN32) endif() if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mstackrealign") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mstackrealign") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + IF(NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mstackrealign") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mstackrealign") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() endif() if(NOT SYSTEM_STK) add_definitions("-D_STK_DEBUG_")