From 227087b3a8150f2e8c98eb0de643a54dba2e81f3 Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Tue, 7 Feb 2017 00:04:56 +0100 Subject: [PATCH] Automatic detection of the ENABLE_SIMD setting for SG: * Scrapped the previous code * Instead use the symbol value imported from SG via the "CONFIG" mode of CMake find_package() --- CMakeLists.txt | 16 +--------------- tests/test-simd-enabled.c | 9 --------- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 tests/test-simd-enabled.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 6026e778e..dadae6e22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -357,23 +357,9 @@ else() message(STATUS "RTI: DISABLED") endif(ENABLE_RTI) -# Check if the flag ENABLE_SIMD was enabled during the compilation of SimGear. -# The same value has to be carried over for FlightGear to prevent crashes. -set(INCLUDE_DIRECTORIES "${SIMGEAR_INCLUDE_DIRS}") -foreach(dir ${CMAKE_PREFIX_PATH}) - set(INCLUDE_DIRECTORIES "${dir}/include;${INCLUDE_DIRECTORIES}") -endforeach() - -try_run(ENABLE_SIMD COMPILE_RESULT_TEST_SIMD ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/tests/test-simd-enabled.c - CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${INCLUDE_DIRECTORIES}") - -if (COMPILE_RESULT_TEST_SIMD AND ENABLE_SIMD - AND NOT (ENABLE_SIMD EQUAL FAILED_TO_RUN)) - set(ENABLE_SIMD ON) +if (ENABLE_SIMD) message(STATUS "SSE/SSE2 support: ENABLED") else() - set(ENABLE_SIMD OFF) message(STATUS "SSE/SSE2 support: DISABLED") endif() diff --git a/tests/test-simd-enabled.c b/tests/test-simd-enabled.c deleted file mode 100644 index 5a6f391ad..000000000 --- a/tests/test-simd-enabled.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "simgear/simgear_config.h" - -int main(void) { - #ifdef ENABLE_SIMD - return 1; - #else - return 0; - #endif -}