rnnoise.cmake 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. option(ENABLE_RNNOISE "Enable building with RNNoise noise supression filter" ON)
  2. if(ENABLE_RNNOISE)
  3. if(OS_WINDOWS OR OS_MACOS)
  4. find_package(Librnnoise REQUIRED)
  5. target_sources(obs-filters PRIVATE noise-suppress-filter.c)
  6. elseif(OS_LINUX OR OS_FREEBSD)
  7. add_library(
  8. obs-rnnoise
  9. INTERFACE
  10. rnnoise/src/arch.h
  11. rnnoise/src/celt_lpc.c
  12. rnnoise/src/celt_lpc.h
  13. rnnoise/src/common.h
  14. rnnoise/src/denoise.c
  15. rnnoise/src/kiss_fft.c
  16. rnnoise/src/kiss_fft.h
  17. rnnoise/src/opus_types.h
  18. rnnoise/src/pitch.c
  19. rnnoise/src/pitch.h
  20. rnnoise/src/rnn_data.c
  21. rnnoise/src/rnn_data.h
  22. rnnoise/src/rnn_reader.c
  23. rnnoise/src/rnn.c
  24. rnnoise/src/rnn.h
  25. rnnoise/src/tansig_table.h
  26. rnnoise/src/_kiss_fft_guts.h
  27. rnnoise/include/rnnoise.h)
  28. add_library(Librnnoise::Librnnoise ALIAS obs-rnnoise)
  29. target_include_directories(obs-rnnoise INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/rnnoise/include")
  30. target_compile_definitions(obs-rnnoise INTERFACE COMPILE_OPUS)
  31. set_target_properties(obs-rnnoise PROPERTIES FOLDER plugins/obs-filters/rnnoise)
  32. endif()
  33. target_compile_definitions(obs-filters PRIVATE LIBRNNOISE_ENABLED)
  34. target_link_libraries(obs-filters PRIVATE Librnnoise::Librnnoise)
  35. target_enable_feature(obs-filters "RNNoise noise suppression" LIBRRNOISE_ENABLED HAS_NOISEREDUCTION)
  36. else()
  37. target_disable_feature(obs-filters "RNNoise noise suppression")
  38. endif()