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 \