You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. set(decoder_srcs
  2. asr_decoder.cc
  3. asr_model.cc
  4. context_graph.cc
  5. ctc_prefix_beam_search.cc
  6. ctc_wfst_beam_search.cc
  7. ctc_endpoint.cc
  8. )
  9. if(NOT TORCH AND NOT ONNX AND NOT XPU AND NOT IOS AND NOT BPU AND NOT OPENVINO)
  10. message(FATAL_ERROR "Please build with TORCH or ONNX or OPENVINO or XPU or IOS or BPU!!!")
  11. endif()
  12. if(TORCH OR IOS)
  13. list(APPEND decoder_srcs torch_asr_model.cc)
  14. endif()
  15. if(ONNX)
  16. list(APPEND decoder_srcs onnx_asr_model.cc)
  17. endif()
  18. add_library(decoder STATIC ${decoder_srcs})
  19. target_link_libraries(decoder PUBLIC kaldi-decoder frontend
  20. post_processor utils)
  21. if(ANDROID)
  22. target_link_libraries(decoder PUBLIC ${PYTORCH_LIBRARY} ${FBJNI_LIBRARY})
  23. else()
  24. if(TORCH)
  25. target_link_libraries(decoder PUBLIC ${TORCH_LIBRARIES})
  26. endif()
  27. if(ONNX)
  28. target_link_libraries(decoder PUBLIC ${third_party_libraries})
  29. endif()
  30. if(BPU)
  31. target_link_libraries(decoder PUBLIC bpu_asr_model)
  32. endif()
  33. if(XPU)
  34. target_link_libraries(decoder PUBLIC xpu_conformer)
  35. endif()
  36. if(OPENVINO)
  37. target_link_libraries(decoder PUBLIC ov_asr_model)
  38. endif()
  39. endif()