shithub: opus

Download patch

ref: 841d57b82a516ccc6e90d1d4aee8d4a7f0d00010
parent: 5bdb3a587db48fc2be7804b58d522bde562dd75d
author: Marcus Asteborg <maastebo@microsoft.com>
date: Fri Jul 31 18:17:49 EDT 2020

cmake - add option for fixed point debug

Signed-off-by: Ralph Giles <giles@thaumas.net>

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,6 +85,14 @@
   add_feature_info(OPUS_BUILD_FRAMEWORK OPUS_BUILD_FRAMEWORK ${OPUS_BUILD_FRAMEWORK_HELP_STR})
 endif()
 
+set(OPUS_FIXED_POINT_DEBUG_HELP_STR "debug fixed-point implementation.")
+cmake_dependent_option(OPUS_FIXED_POINT_DEBUG
+                      ${OPUS_FIXED_POINT_DEBUG_HELP_STR}
+                      ON
+                      "OPUS_FIXED_POINT; OPUS_FIXED_POINT_DEBUG"
+                      OFF)
+add_feature_info(OPUS_FIXED_POINT_DEBUG OPUS_FIXED_POINT_DEBUG ${OPUS_FIXED_POINT_DEBUG_HELP_STR})
+
 set(OPUS_VAR_ARRAYS_HELP_STR "use variable length arrays for stack arrays.")
 cmake_dependent_option(OPUS_VAR_ARRAYS
                       ${OPUS_VAR_ARRAYS_HELP_STR}
@@ -271,6 +279,10 @@
 
 target_link_libraries(opus PRIVATE ${OPUS_REQUIRED_LIBRARIES})
 target_compile_definitions(opus PRIVATE OPUS_BUILD)
+
+if(OPUS_FIXED_POINT_DEBUG)
+  target_compile_definitions(opus PRIVATE FIXED_DEBUG)
+endif()
 
 if(OPUS_FORTIFY_SOURCE AND NOT MSVC)
   target_compile_definitions(opus PRIVATE