aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuno Senica <nsenica@gmail.com>2017-01-05 12:54:58 +0000
committerNuno Senica <nsenica@gmail.com>2017-01-05 12:54:58 +0000
commit3d1431ddfeea8a1911ff64af01e1579809ffbc46 (patch)
tree3c384acc0a9c6ca223f83243bfeb5650215b7056
parentf55db4d3cad310a4202da095dc576f5369b660dd (diff)
[cmake] Move NEON flags to platform specific ArchSetup so its easily customizable per platform and respect ENABLE_NEON flag.
-rw-r--r--cmake/scripts/android/ArchSetup.cmake1
-rw-r--r--cmake/scripts/common/ArchSetup.cmake2
-rw-r--r--cmake/scripts/linux/ArchSetup.cmake1
-rw-r--r--cmake/scripts/rbpi/ArchSetup.cmake3
4 files changed, 6 insertions, 1 deletions
diff --git a/cmake/scripts/android/ArchSetup.cmake b/cmake/scripts/android/ArchSetup.cmake
index 1337e5a1e3..614b722a99 100644
--- a/cmake/scripts/android/ArchSetup.cmake
+++ b/cmake/scripts/android/ArchSetup.cmake
@@ -14,6 +14,7 @@ else()
if(CPU STREQUAL armeabi-v7a)
set(ARCH arm)
set(NEON True)
+ set(NEON_FLAGS "-mfpu=neon -mvectorize-with-neon-quad")
elseif(CPU STREQUAL arm64-v8a)
set(ARCH aarch64)
elseif(CPU STREQUAL i686)
diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake
index 58b2cfe44b..74afc8ccaf 100644
--- a/cmake/scripts/common/ArchSetup.cmake
+++ b/cmake/scripts/common/ArchSetup.cmake
@@ -146,7 +146,7 @@ if(NOT DEFINED NEON OR NEON)
option(ENABLE_NEON "Enable NEON optimization" ${NEON})
if(ENABLE_NEON)
message(STATUS "NEON optimization enabled")
- add_options(CXX ALL_BUILDS "-mfpu=neon -mvectorize-with-neon-quad")
+ add_options(ALL_LANGUAGES ALL_BUILDS ${NEON_FLAGS})
endif()
endif()
diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake
index 20342ee76c..eeed920aff 100644
--- a/cmake/scripts/linux/ArchSetup.cmake
+++ b/cmake/scripts/linux/ArchSetup.cmake
@@ -16,6 +16,7 @@ else()
elseif(CPU MATCHES arm)
set(ARCH arm)
set(NEON True)
+ set(NEON_FLAGS "-mfpu=neon -mvectorize-with-neon-quad")
elseif(CPU MATCHES aarch64 OR CPU MATCHES arm64)
set(ARCH aarch64)
set(NEON False)
diff --git a/cmake/scripts/rbpi/ArchSetup.cmake b/cmake/scripts/rbpi/ArchSetup.cmake
index b083e235c0..9cae927c73 100644
--- a/cmake/scripts/rbpi/ArchSetup.cmake
+++ b/cmake/scripts/rbpi/ArchSetup.cmake
@@ -13,9 +13,12 @@ else()
if(CPU STREQUAL arm1176jzf-s)
set(ARCH arm)
set(NEON False)
+ set(NEON_FLAGS "-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp")
elseif(CPU MATCHES "cortex-a7" OR CPU MATCHES "cortex-a53")
set(ARCH arm)
set(NEON True)
+ set(NEON_FLAGS "-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread")
else()
message(SEND_ERROR "Unknown CPU: ${CPU}")
endif()