From d7471482d133c00c61016335c8518b02c6ac9bc7 Mon Sep 17 00:00:00 2001 From: iphydf Date: Thu, 22 Feb 2018 13:56:11 +0000 Subject: [PATCH] Add an option that allows us to specify that we require toxav. --- CMakeLists.txt | 11 +++++++++-- other/travis/toxcore-script | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3262471b..cea97fce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,16 +188,23 @@ if(NOT USE_IPV6) endif() option(BUILD_TOXAV "Whether to build the tox AV library" ON) +option(MUST_BUILD_TOXAV "Fail the build if toxav cannot be built" OFF) include(Dependencies) +if(MUST_BUILD_TOXAV) + set(NO_TOXAV_ERROR_TYPE SEND_ERROR) +else() + set(NO_TOXAV_ERROR_TYPE WARNING) +endif() + if(BUILD_TOXAV) if(NOT OPUS_FOUND) - message(WARNING "Option BUILD_TOXAV is enabled but required library OPUS was not found.") + message(${NO_TOXAV_ERROR_TYPE} "Option BUILD_TOXAV is enabled but required library OPUS was not found.") set(BUILD_TOXAV OFF) endif() if(NOT VPX_FOUND) - message(WARNING "Option BUILD_TOXAV is enabled but required library VPX was not found.") + message(${NO_TOXAV_ERROR_TYPE} "Option BUILD_TOXAV is enabled but required library VPX was not found.") set(BUILD_TOXAV OFF) endif() endif() diff --git a/other/travis/toxcore-script b/other/travis/toxcore-script index 65c4c7b5..83ca8c04 100755 --- a/other/travis/toxcore-script +++ b/other/travis/toxcore-script @@ -30,6 +30,7 @@ RUN $CMAKE \ -DCMAKE_INSTALL_PREFIX:PATH=$CURDIR/_install \ -DASAN=ON \ -DDEBUG=ON \ + -DMUST_BUILD_TOXAV=ON \ -DSTRICT_ABI=ON \ -DTEST_TIMEOUT_SECONDS=120 \ -DTRACE=ON \