diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 621759afa..1435e68de 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -150,6 +150,19 @@ if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX endif() endif() +# Disable complex math NaN/INFO range checking for performance +include(CheckCXXCompilerFlag) +check_cxx_compiler_flag(-fcx-limited-range HAVE_CX_LIMITED_RANGE) +if(HAVE_CX_LIMITED_RANGE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcx-limited-range") +endif() + +include(CheckCCompilerFlag) +check_c_compiler_flag(-fcx-limited-range HAVE_C_LIMITED_RANGE) +if(HAVE_C_LIMITED_RANGE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcx-limited-range") +endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")