Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Asteborg <maastebo@microsoft.com>2020-04-14 01:59:50 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2020-04-21 05:47:56 +0300
commitc5c986a3a9d3035b4813998a5f903b6758c456c9 (patch)
tree4e810bbf0bf1eb8ebd86f137125162c9ec3b6f33 /CMakeLists.txt
parenta0e14e7117fbb05e0ebcfd891188746096531d02 (diff)
cmake - add option for float_approx for IEEE 754 compatible targets
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5d04d83..995109b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,9 @@ option(OPUS_FIXED_POINT
option(OPUS_ENABLE_FLOAT_API
"Compile with the floating point API (for machines with float library"
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_CMAKE_CONFIG_MODULE "Install CMake package config module"
ON)
@@ -171,6 +174,8 @@ add_feature_info(
add_feature_info(
OPUS_FLOAT_API OPUS_ENABLE_FLOAT_API
"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
"install PkgConfig module")
add_feature_info(OPUS_INSTALL_CMAKE_CONFIG_MODULE OPUS_INSTALL_CMAKE_CONFIG_MODULE
@@ -234,6 +239,10 @@ if(NOT MSVC)
target_compile_definitions(opus PRIVATE _FORTIFY_SOURCE=2)
endif()
+if(OPUS_FLOAT_APPROX)
+ target_compile_definitions(opus PRIVATE FLOAT_APPROX)
+endif()
+
if(OPUS_VAR_ARRAYS)
target_compile_definitions(opus PRIVATE VAR_ARRAYS)
elseif(OPUS_USE_ALLOCA)