From e3b3322c397ebb16843fba75e391a68c2148b2be Mon Sep 17 00:00:00 2001 From: Nicholas Guriev Date: Tue, 18 Jan 2022 12:30:32 +0300 Subject: [PATCH] New DESKTOP_APP_USE_RNNOISE switch RNNoise comes with an ML model trained using closed data. That's unacceptable in most Linux distributions due to legal issues. See discussion on Debian bug tracker: https://bugs.debian.org/980839#17 --- external/rnnoise/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/external/rnnoise/CMakeLists.txt b/external/rnnoise/CMakeLists.txt index 7d68d930..08b28db9 100644 --- a/external/rnnoise/CMakeLists.txt +++ b/external/rnnoise/CMakeLists.txt @@ -9,9 +9,18 @@ if (DESKTOP_APP_USE_PACKAGED) add_library(desktop-app::external_rnnoise ALIAS external_rnnoise) find_package(PkgConfig REQUIRED) - pkg_check_modules(RNNOISE REQUIRED IMPORTED_TARGET rnnoise) + if (NOT DEFINED DESKTOP_APP_USE_RNNOISE) + pkg_check_modules(RNNOISE IMPORTED_TARGET rnnoise) + elseif (DESKTOP_APP_USE_RNNOISE) + pkg_check_modules(RNNOISE REQUIRED IMPORTED_TARGET rnnoise) + endif() + set(DESKTOP_APP_USE_RNNOISE ${RNNOISE_FOUND} CACHE BOOL "Compile against RNNoise or not?") - target_link_libraries(external_rnnoise INTERFACE PkgConfig::RNNOISE) + if (RNNOISE_FOUND) + target_link_libraries(external_rnnoise INTERFACE PkgConfig::RNNOISE) + else() + target_compile_definitions(external_rnnoise INTERFACE USE_RNNOISE=0) + endif() return() endif()