Unverified Commit 7f035cc6 authored by Marcus Asteborg's avatar Marcus Asteborg Committed by Jean-Marc Valin
Browse files

cmake - add option for fast math


Signed-off-by: Jean-Marc Valin's avatarJean-Marc Valin <jmvalin@jmvalin.ca>
parent c5c986a3
......@@ -59,6 +59,20 @@ cmake_dependent_option(OPUS_NONTHREADSAFE_PSEUDOSTACK
"NOT OPUS_VAR_ARRAYS; NOT OPUS_USE_ALLOCA"
OFF)
cmake_dependent_option(OPUS_FAST_MATH
"Enable fast math"
ON
"OPUS_FLOAT_APPROX; OPUS_FAST_MATH"
OFF)
if(OPUS_FAST_MATH)
if(MSVC)
check_and_set_flag(FAST_MATH /fp:fast)
else()
check_and_set_flag(FAST_MATH -ffast-math)
endif()
endif()
if(OPUS_BUILD_SHARED_LIBRARY OR BUILD_SHARED_LIBS)
# Global flag to cause add_library() to create shared libraries if on.
set(BUILD_SHARED_LIBS ON)
......@@ -176,6 +190,7 @@ add_feature_info(
"compile with the floating point API (for machines with float library)")
add_feature_info(OPUS_FLOAT_APPROX OPUS_FLOAT_APPROX
"Enable floating point approximations (Ensure your platform supports IEEE 754 before enabling)")
add_feature_info(OPUS_FAST_MATH FAST_MATH_SUPPORTED "Enable fast math, (depending on OPUS_FLOAT_APPROX to be enabled)")
add_feature_info(OPUS_INSTALL_PKG_CONFIG_MODULE OPUS_INSTALL_PKG_CONFIG_MODULE
"install PkgConfig module")
add_feature_info(OPUS_INSTALL_CMAKE_CONFIG_MODULE OPUS_INSTALL_CMAKE_CONFIG_MODULE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment