Skip to content

Commit

Permalink
New DESKTOP_APP_USE_RNNOISE switch
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mymedia2 committed Jan 18, 2022
1 parent a23f714 commit e3b3322
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions external/rnnoise/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit e3b3322

Please sign in to comment.