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

cmake - add option for float_approx for IEEE 754 compatible targets


Signed-off-by: Jean-Marc Valin's avatarJean-Marc Valin <jmvalin@jmvalin.ca>
parent a0e14e71
...@@ -30,6 +30,9 @@ option(OPUS_FIXED_POINT ...@@ -30,6 +30,9 @@ option(OPUS_FIXED_POINT
option(OPUS_ENABLE_FLOAT_API option(OPUS_ENABLE_FLOAT_API
"Compile with the floating point API (for machines with float library" "Compile with the floating point API (for machines with float library"
ON) ON)
option(OPUS_FLOAT_APPROX
"Enable floating point approximations (Ensure your platform supports IEEE 754 before enabling)"
OFF)
option(OPUS_INSTALL_PKG_CONFIG_MODULE "Install PkgConfig module" ON) option(OPUS_INSTALL_PKG_CONFIG_MODULE "Install PkgConfig module" ON)
option(OPUS_INSTALL_CMAKE_CONFIG_MODULE "Install CMake package config module" option(OPUS_INSTALL_CMAKE_CONFIG_MODULE "Install CMake package config module"
ON) ON)
...@@ -171,6 +174,8 @@ add_feature_info( ...@@ -171,6 +174,8 @@ add_feature_info(
add_feature_info( add_feature_info(
OPUS_FLOAT_API OPUS_ENABLE_FLOAT_API OPUS_FLOAT_API OPUS_ENABLE_FLOAT_API
"compile with the floating point API (for machines with float library)") "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_INSTALL_PKG_CONFIG_MODULE OPUS_INSTALL_PKG_CONFIG_MODULE add_feature_info(OPUS_INSTALL_PKG_CONFIG_MODULE OPUS_INSTALL_PKG_CONFIG_MODULE
"install PkgConfig module") "install PkgConfig module")
add_feature_info(OPUS_INSTALL_CMAKE_CONFIG_MODULE OPUS_INSTALL_CMAKE_CONFIG_MODULE add_feature_info(OPUS_INSTALL_CMAKE_CONFIG_MODULE OPUS_INSTALL_CMAKE_CONFIG_MODULE
...@@ -234,6 +239,10 @@ if(NOT MSVC) ...@@ -234,6 +239,10 @@ if(NOT MSVC)
target_compile_definitions(opus PRIVATE _FORTIFY_SOURCE=2) target_compile_definitions(opus PRIVATE _FORTIFY_SOURCE=2)
endif() endif()
if(OPUS_FLOAT_APPROX)
target_compile_definitions(opus PRIVATE FLOAT_APPROX)
endif()
if(OPUS_VAR_ARRAYS) if(OPUS_VAR_ARRAYS)
target_compile_definitions(opus PRIVATE VAR_ARRAYS) target_compile_definitions(opus PRIVATE VAR_ARRAYS)
elseif(OPUS_USE_ALLOCA) elseif(OPUS_USE_ALLOCA)
......
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