summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJukka Ojanen <jukka.ojanen@linkotec.net>2016-04-07 12:01:57 +0300
committerJukka Ojanen <jukka.ojanen@linkotec.net>2016-04-07 12:01:57 +0300
commit944d14c9151f6b20145de0cdae38e366e73c9432 (patch)
tree33e17e0a166f03307ebf11e8ab2891ae1ab90f61
parentc85bf4b4a7a1199d9c48c24ec5a49ea0b16e1af1 (diff)
downloadffts-944d14c9151f6b20145de0cdae38e366e73c9432.zip
ffts-944d14c9151f6b20145de0cdae38e366e73c9432.tar.gz
If the system is not ARM or x86 based, we will have invalid set of compiler flags
-rw-r--r--CMakeLists.txt9
1 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c21185..2028c03 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,11 +82,13 @@ if(HAVE_UNISTD_H)
add_definitions(-DHAVE_UNISTD_H)
endif(HAVE_UNISTD_H)
+# backup flags
+set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
+
# Determinate if we are cross-compiling
if(NOT CMAKE_CROSSCOMPILING)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
# Determinate ARM architecture
- set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
# Try to execute quietly without messages
set(CMAKE_REQUIRED_QUIET 1)
@@ -230,8 +232,6 @@ if(NOT CMAKE_CROSSCOMPILING)
endif(NOT HARDFP_SUPPORTED)
endif(NOT NEON_HARDFP_SUPPORTED AND NOT NEON_SOFTFP_SUPPORTED)
else()
- set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
-
# enable SSE code generation
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_SAVE} -msse")
@@ -294,6 +294,9 @@ else()
# TODO: Add detections for compiler support and headers
endif(NOT CMAKE_CROSSCOMPILING)
+# restore flags
+set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
+
# compiler settings
if(MSVC)
# enable all warnings but also disable some..
OpenPOWER on IntegriCloud