aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2015-07-06 09:22:36 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2015-07-06 09:22:36 +0200
commit17f17b7799551e94b84b4f27d5a6d26bde22d15a (patch)
tree06446417692c61fe936e9f77feba87eb8eb4152f /CMakeLists.txt
parentb772dc8328d3b045ff364b36e9ce9502042e62be (diff)
downloadsynthpod-17f17b7799551e94b84b4f27d5a6d26bde22d15a.tar.xz
add discovery of compiler vectorization support.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50da6967..6b5210d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,16 +26,22 @@ set(SYNTHPOD_MICRO_VERSION 1)
set(SYNTHPOD_VERSION "${SYNTHPOD_MAJOR_VERSION}.${SYNTHPOD_MINOR_VERSION}.${SYNTHPOD_MICRO_VERSION}")
add_definitions("-DSYNTHPOD_VERSION=\"${SYNTHPOD_VERSION}\"")
-set(CMAKE_C_FLAGS "-std=gnu11 -ffast-math -ftree-vectorize ${CMAKE_C_FLAGS}")
-
-#set(CMAKE_C_FLAGS "-ftree-vectorizer-verbose=1 ${CMAKE_C_FLAGS}")
-#set(CMAKE_C_FLAGS "-Rpass=loop-vectorize ${CMAKE_C_FLAGS}")
+set(CMAKE_C_FLAGS "-std=gnu11 -ffast-math ${CMAKE_C_FLAGS}")
# options
option(BUILD_UI "Build user interface libraries" ON)
option(BUILD_JACK "Build JACK standalone host" ON)
option(BUILD_PORTAUDIO "Build PortAudio standalone host (broken)" OFF)
+# vectorization
+include(CheckCCompilerFlag)
+CHECK_C_COMPILER_FLAG("-ftree-vectorize" CAN_VECTORIZE)
+if(${CAN_VECTORIZE})
+ set(CMAKE_C_FLAGS "-ftree-vectorize ${CMAKE_C_FLAGS}")
+ #set(CMAKE_C_FLAGS "-ftree-vectorizer-verbose=1 ${CMAKE_C_FLAGS}") # GCC
+ #set(CMAKE_C_FLAGS "-Rpass=loop-vectorize ${CMAKE_C_FLAGS}") # CLANG
+endif()
+
# eina
pkg_search_module(EINA REQUIRED eina>=1.8)
include_directories(${EINA_INCLUDE_DIRS})