diff options
author | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-08-28 17:03:07 +0300 |
---|---|---|
committer | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-08-28 17:03:07 +0300 |
commit | a54d9fd7ef21f25bf76ea650248adc983968492e (patch) | |
tree | ef72f2de826145a90db3de241fdf570dd2382254 | |
parent | 5f0db6e851fc5d0b3db83b140e81cd7b0d4733f0 (diff) | |
download | ffts-a54d9fd7ef21f25bf76ea650248adc983968492e.zip ffts-a54d9fd7ef21f25bf76ea650248adc983968492e.tar.gz |
Avoid problems with different versions of CMakePushCheckState macros and fix float-abi test
-rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 63e636f..c3c703d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,6 @@ option(ENABLE_SHARED include(CheckCSourceCompiles) include(CheckIncludeFile) include(CheckSymbolExists) -include(CMakePushCheckState) add_definitions(-DFFTS_CMAKE_GENERATED) @@ -76,49 +75,43 @@ if(NOT CMAKE_CROSSCOMPILING) # Determinate what floating-point hardware # (or hardware emulation) is available # - cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) # Try to execute quietly without messages set(CMAKE_REQUIRED_QUIET 1) # Test compilation with -mfpu=neon - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mfpu=neon") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_SAVE} -mfpu=neon") check_symbol_exists(exit stdlib.h NEON_AVAILABLE) if(NOT NEON_AVAILABLE) - cmake_reset_check_state() - # Test compilation with -mfpu=vfp - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mfpu=vfp") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_SAVE} -mfpu=vfp") check_symbol_exists(exit stdlib.h VFP_AVAILABLE) if(NOT VFP_AVAILABLE) message(WARNING "FFTS is using 'soft' FPU") else() message("FFTS is using 'vfp' FPU") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=vfp") - set(ENABLE_NEON 0) set(ENABLE_VFP 1) endif(NOT SOFTFP_AVAILABLE) else() message("FFTS is using 'neon' FPU") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon") - set(ENABLE_NEON 1) set(ENABLE_VFP 0) endif(NOT NEON_AVAILABLE) # Determinate float ABI if NEON or VFP is used if(NEON_AVAILABLE OR VFP_AVAILABLE) - cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) # Test compilation with -mfloat-abi=hard - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mfloat-abi=hardfp") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_SAVE} -mfloat-abi=hard") check_symbol_exists(exit stdlib.h HARDFP_AVAILABLE) if(NOT HARDFP_AVAILABLE) - cmake_reset_check_state() - - # Test compilation with -mfloat-abi=hard - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mfloat-abi=softfp") + # Test compilation with -mfloat-abi=softfp + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_SAVE} -mfloat-abi=softfp") check_symbol_exists(exit stdlib.h SOFTFP_AVAILABLE) if(NOT SOFTFP_AVAILABLE) # Most likely development libraries are missing @@ -131,11 +124,7 @@ if(NOT CMAKE_CROSSCOMPILING) message(WARNING "FFTS is using 'hard' float ABI") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=hard") endif(NOT HARDFP_AVAILABLE) - - cmake_pop_check_state() endif(NEON_AVAILABLE OR VFP_AVAILABLE) - - cmake_pop_check_state() else() # check if the platform has support for SSE intrinsics check_include_file(xmmintrin.h HAVE_XMMINTRIN_H) |