From 944d14c9151f6b20145de0cdae38e366e73c9432 Mon Sep 17 00:00:00 2001 From: Jukka Ojanen Date: Thu, 7 Apr 2016 12:01:57 +0300 Subject: If the system is not ARM or x86 based, we will have invalid set of compiler flags --- CMakeLists.txt | 9 ++++++--- 1 file 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.. -- cgit v1.1