ref: 1d5c8152f4fc03d1518fea16181885923279f012
parent: f040fb0de0ee05f01622075ecde881697ee01c69
author: Marcus Asteborg <maastebo@microsoft.com>
date: Fri Nov 20 16:12:56 EST 2020
cmake - add option for assertions Signed-off-by: Ralph Giles <giles@thaumas.net>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,6 +55,10 @@
option(OPUS_FLOAT_APPROX ${OPUS_FLOAT_APPROX_HELP_STR} OFF)
add_feature_info(OPUS_FLOAT_APPROX OPUS_FLOAT_APPROX ${OPUS_FLOAT_APPROX_HELP_STR})
+set(OPUS_ASSERTIONS_HELP_STR "additional software error checking.")
+option(OPUS_ASSERTIONS ${OPUS_ASSERTIONS_HELP_STR} OFF)
+add_feature_info(OPUS_ASSERTIONS OPUS_ASSERTIONS ${OPUS_ASSERTIONS_HELP_STR})
+
set(OPUS_INSTALL_PKG_CONFIG_MODULE_HELP_STR "install pkg-config module.")
option(OPUS_INSTALL_PKG_CONFIG_MODULE ${OPUS_INSTALL_PKG_CONFIG_MODULE_HELP_STR} ON)
add_feature_info(OPUS_INSTALL_PKG_CONFIG_MODULE OPUS_INSTALL_PKG_CONFIG_MODULE ${OPUS_INSTALL_PKG_CONFIG_MODULE_HELP_STR})
@@ -263,6 +267,10 @@
if(OPUS_FLOAT_APPROX)
target_compile_definitions(opus PRIVATE FLOAT_APPROX)
+endif()
+
+if(OPUS_ASSERTIONS)
+ target_compile_definitions(opus PRIVATE ENABLE_ASSERTIONS)
endif()
if(OPUS_VAR_ARRAYS)