summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMarcus Asteborg <maastebo@microsoft.com>2020-11-20 21:28:56 -0800
committerRalph Giles <giles@thaumas.net>2020-11-21 08:41:29 -0800
commit2f37feb7cec9f856a05665b2ee7f41452767b9a1 (patch)
tree4f3b054fdd559b9f7fc47ac9ac3be8e93b3aba21 /CMakeLists.txt
parentb459e4cedab04ffb4047a0adf5f3b03149c29e80 (diff)
downloadopus-2f37feb7cec9f856a05665b2ee7f41452767b9a1.tar.gz
cmake - add option for fuzzing
Signed-off-by: Ralph Giles <giles@thaumas.net>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1db49749..96a18844 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,6 +63,10 @@ set(OPUS_HARDENING_HELP_STR "run-time checks that are cheap and safe for use in
option(OPUS_HARDENING ${OPUS_HARDENING_HELP_STR} ON)
add_feature_info(OPUS_HARDENING OPUS_HARDENING ${OPUS_HARDENING_HELP_STR})
+set(OPUS_FUZZING_HELP_STR "causes the encoder to make random decisions (do not use in production).")
+option(OPUS_FUZZING ${OPUS_FUZZING_HELP_STR} OFF)
+add_feature_info(OPUS_FUZZING OPUS_FUZZING ${OPUS_FUZZING_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})
@@ -281,6 +285,10 @@ if(OPUS_HARDENING)
target_compile_definitions(opus PRIVATE ENABLE_HARDENING)
endif()
+if(OPUS_FUZZING)
+ target_compile_definitions(opus PRIVATE FUZZING)
+endif()
+
if(OPUS_VAR_ARRAYS)
target_compile_definitions(opus PRIVATE VAR_ARRAYS)
elseif(OPUS_USE_ALLOCA)