Skip to content

Commit 3bb0d1c

Browse files
localai-botmudler
andauthored
feat(backend): add moss-tts-cpp text-to-speech backend (#10860)
* feat(backend): add moss-tts-cpp text-to-speech backend Add a Go + purego backend wrapping the moss-tts.cpp ggml port of the OpenMOSS MOSS-TTS-Local v1.5 text-to-speech model (GPT-J local transformer decoded through MOSS-Audio-Tokenizer-v2), producing 48 kHz stereo audio with optional reference-audio voice cloning. Mirrors the qwen3-tts-cpp backend: dlopen the static-ggml shared library, bind the moss-tts.cpp C-API via purego, and serve the gRPC TTS method. A thin C shim holds the pipeline handle and copies engine PCM into a Go-freeable buffer. Wires the CI registration: backend-matrix.yml (CPU, CUDA 12/13, Intel SYCL f16/f32, Vulkan, ROCm, NVIDIA L4T, plus Darwin metal), backend/index.yaml metas and image entries pointing at mudler/MOSS-TTS-Local-Transformer-v1.5-GGUF, the root Makefile build targets, and the changed-backends.js path mapping. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * docs: list the moss-tts-cpp backend among the LocalAI-maintained engines Add moss-tts.cpp to the README "Backends built by us" table, the Text-to-Speech compatibility table, and the reference-audio voice-cloning backend list, so the new backend is documented alongside its peers. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * backend(moss-tts-cpp): pin moss-tts.cpp to the squashed single-commit release moss-tts.cpp history was collapsed to a single commit; repoint MOSSTTS_CPP_VERSION to ee722b8e9205ee9b1b1c398a4e87e4e393e9be41. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * backend(moss-tts-cpp): add the moss-tts-cpp-development gallery meta The gallery had the -development image entries but no matching -development meta anchor (as locate-anything-cpp and depth-anything-cpp have), so the master build was not installable as a gallery backend. Add moss-tts-cpp-development mirroring the production meta with the -development capability image names. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 0bd7a29 commit 3bb0d1c

23 files changed

Lines changed: 1591 additions & 3 deletions

.github/backend-matrix.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,19 @@ include:
858858
dockerfile: "./backend/Dockerfile.golang"
859859
context: "./"
860860
ubuntu-version: '2404'
861+
- build-type: 'cublas'
862+
cuda-major-version: "12"
863+
cuda-minor-version: "8"
864+
platforms: 'linux/amd64'
865+
tag-latest: 'auto'
866+
tag-suffix: '-gpu-nvidia-cuda-12-moss-tts-cpp'
867+
runs-on: 'ubuntu-latest'
868+
base-image: "ubuntu:24.04"
869+
skip-drivers: 'false'
870+
backend: "moss-tts-cpp"
871+
dockerfile: "./backend/Dockerfile.golang"
872+
context: "./"
873+
ubuntu-version: '2404'
861874
- build-type: 'cublas'
862875
cuda-major-version: "12"
863876
cuda-minor-version: "8"
@@ -1909,6 +1922,19 @@ include:
19091922
dockerfile: "./backend/Dockerfile.golang"
19101923
context: "./"
19111924
ubuntu-version: '2404'
1925+
- build-type: 'cublas'
1926+
cuda-major-version: "13"
1927+
cuda-minor-version: "0"
1928+
platforms: 'linux/amd64'
1929+
tag-latest: 'auto'
1930+
tag-suffix: '-gpu-nvidia-cuda-13-moss-tts-cpp'
1931+
runs-on: 'ubuntu-latest'
1932+
base-image: "ubuntu:24.04"
1933+
skip-drivers: 'false'
1934+
backend: "moss-tts-cpp"
1935+
dockerfile: "./backend/Dockerfile.golang"
1936+
context: "./"
1937+
ubuntu-version: '2404'
19121938
- build-type: 'cublas'
19131939
cuda-major-version: "13"
19141940
cuda-minor-version: "0"
@@ -1961,6 +1987,19 @@ include:
19611987
backend: "qwen3-tts-cpp"
19621988
dockerfile: "./backend/Dockerfile.golang"
19631989
context: "./"
1990+
- build-type: 'cublas'
1991+
cuda-major-version: "13"
1992+
cuda-minor-version: "0"
1993+
platforms: 'linux/arm64'
1994+
skip-drivers: 'false'
1995+
tag-latest: 'auto'
1996+
tag-suffix: '-nvidia-l4t-cuda-13-arm64-moss-tts-cpp'
1997+
base-image: "ubuntu:24.04"
1998+
ubuntu-version: '2404'
1999+
runs-on: 'ubuntu-24.04-arm'
2000+
backend: "moss-tts-cpp"
2001+
dockerfile: "./backend/Dockerfile.golang"
2002+
context: "./"
19642003
- build-type: 'cublas'
19652004
cuda-major-version: "13"
19662005
cuda-minor-version: "0"
@@ -4529,6 +4568,35 @@ include:
45294568
dockerfile: "./backend/Dockerfile.golang"
45304569
context: "./"
45314570
ubuntu-version: '2404'
4571+
# moss-tts-cpp
4572+
- build-type: ''
4573+
cuda-major-version: ""
4574+
cuda-minor-version: ""
4575+
platforms: 'linux/amd64'
4576+
platform-tag: 'amd64'
4577+
tag-latest: 'auto'
4578+
tag-suffix: '-cpu-moss-tts-cpp'
4579+
runs-on: 'ubuntu-latest'
4580+
base-image: "ubuntu:24.04"
4581+
skip-drivers: 'false'
4582+
backend: "moss-tts-cpp"
4583+
dockerfile: "./backend/Dockerfile.golang"
4584+
context: "./"
4585+
ubuntu-version: '2404'
4586+
- build-type: ''
4587+
cuda-major-version: ""
4588+
cuda-minor-version: ""
4589+
platforms: 'linux/arm64'
4590+
platform-tag: 'arm64'
4591+
tag-latest: 'auto'
4592+
tag-suffix: '-cpu-moss-tts-cpp'
4593+
runs-on: 'ubuntu-24.04-arm'
4594+
base-image: "ubuntu:24.04"
4595+
skip-drivers: 'false'
4596+
backend: "moss-tts-cpp"
4597+
dockerfile: "./backend/Dockerfile.golang"
4598+
context: "./"
4599+
ubuntu-version: '2404'
45324600
# omnivoice-cpp
45334601
- build-type: ''
45344602
cuda-major-version: ""
@@ -4571,6 +4639,19 @@ include:
45714639
dockerfile: "./backend/Dockerfile.golang"
45724640
context: "./"
45734641
ubuntu-version: '2404'
4642+
- build-type: 'sycl_f32'
4643+
cuda-major-version: ""
4644+
cuda-minor-version: ""
4645+
platforms: 'linux/amd64'
4646+
tag-latest: 'auto'
4647+
tag-suffix: '-gpu-intel-sycl-f32-moss-tts-cpp'
4648+
runs-on: 'ubuntu-latest'
4649+
base-image: "intel/oneapi-basekit:2025.3.0-0-devel-ubuntu24.04"
4650+
skip-drivers: 'false'
4651+
backend: "moss-tts-cpp"
4652+
dockerfile: "./backend/Dockerfile.golang"
4653+
context: "./"
4654+
ubuntu-version: '2404'
45744655
- build-type: 'sycl_f32'
45754656
cuda-major-version: ""
45764657
cuda-minor-version: ""
@@ -4597,6 +4678,19 @@ include:
45974678
dockerfile: "./backend/Dockerfile.golang"
45984679
context: "./"
45994680
ubuntu-version: '2404'
4681+
- build-type: 'sycl_f16'
4682+
cuda-major-version: ""
4683+
cuda-minor-version: ""
4684+
platforms: 'linux/amd64'
4685+
tag-latest: 'auto'
4686+
tag-suffix: '-gpu-intel-sycl-f16-moss-tts-cpp'
4687+
runs-on: 'ubuntu-latest'
4688+
base-image: "intel/oneapi-basekit:2025.3.0-0-devel-ubuntu24.04"
4689+
skip-drivers: 'false'
4690+
backend: "moss-tts-cpp"
4691+
dockerfile: "./backend/Dockerfile.golang"
4692+
context: "./"
4693+
ubuntu-version: '2404'
46004694
- build-type: 'sycl_f16'
46014695
cuda-major-version: ""
46024696
cuda-minor-version: ""
@@ -4624,6 +4718,20 @@ include:
46244718
dockerfile: "./backend/Dockerfile.golang"
46254719
context: "./"
46264720
ubuntu-version: '2404'
4721+
- build-type: 'vulkan'
4722+
cuda-major-version: ""
4723+
cuda-minor-version: ""
4724+
platforms: 'linux/amd64'
4725+
platform-tag: 'amd64'
4726+
tag-latest: 'auto'
4727+
tag-suffix: '-gpu-vulkan-moss-tts-cpp'
4728+
runs-on: 'ubuntu-latest'
4729+
base-image: "ubuntu:24.04"
4730+
skip-drivers: 'false'
4731+
backend: "moss-tts-cpp"
4732+
dockerfile: "./backend/Dockerfile.golang"
4733+
context: "./"
4734+
ubuntu-version: '2404'
46274735
- build-type: 'vulkan'
46284736
cuda-major-version: ""
46294737
cuda-minor-version: ""
@@ -4652,6 +4760,20 @@ include:
46524760
dockerfile: "./backend/Dockerfile.golang"
46534761
context: "./"
46544762
ubuntu-version: '2404'
4763+
- build-type: 'vulkan'
4764+
cuda-major-version: ""
4765+
cuda-minor-version: ""
4766+
platforms: 'linux/arm64'
4767+
platform-tag: 'arm64'
4768+
tag-latest: 'auto'
4769+
tag-suffix: '-gpu-vulkan-moss-tts-cpp'
4770+
runs-on: 'ubuntu-24.04-arm'
4771+
base-image: "ubuntu:24.04"
4772+
skip-drivers: 'false'
4773+
backend: "moss-tts-cpp"
4774+
dockerfile: "./backend/Dockerfile.golang"
4775+
context: "./"
4776+
ubuntu-version: '2404'
46554777
- build-type: 'vulkan'
46564778
cuda-major-version: ""
46574779
cuda-minor-version: ""
@@ -4679,6 +4801,19 @@ include:
46794801
dockerfile: "./backend/Dockerfile.golang"
46804802
context: "./"
46814803
ubuntu-version: '2204'
4804+
- build-type: 'cublas'
4805+
cuda-major-version: "12"
4806+
cuda-minor-version: "0"
4807+
platforms: 'linux/arm64'
4808+
skip-drivers: 'false'
4809+
tag-latest: 'auto'
4810+
tag-suffix: '-nvidia-l4t-arm64-moss-tts-cpp'
4811+
base-image: "nvcr.io/nvidia/l4t-jetpack:r36.4.0"
4812+
runs-on: 'ubuntu-24.04-arm'
4813+
backend: "moss-tts-cpp"
4814+
dockerfile: "./backend/Dockerfile.golang"
4815+
context: "./"
4816+
ubuntu-version: '2204'
46824817
- build-type: 'cublas'
46834818
cuda-major-version: "12"
46844819
cuda-minor-version: "0"
@@ -4705,6 +4840,19 @@ include:
47054840
dockerfile: "./backend/Dockerfile.golang"
47064841
context: "./"
47074842
ubuntu-version: '2404'
4843+
- build-type: 'hipblas'
4844+
cuda-major-version: ""
4845+
cuda-minor-version: ""
4846+
platforms: 'linux/amd64'
4847+
tag-latest: 'auto'
4848+
tag-suffix: '-gpu-rocm-hipblas-moss-tts-cpp'
4849+
base-image: "rocm/dev-ubuntu-24.04:6.4.4"
4850+
runs-on: 'ubuntu-latest'
4851+
skip-drivers: 'false'
4852+
backend: "moss-tts-cpp"
4853+
dockerfile: "./backend/Dockerfile.golang"
4854+
context: "./"
4855+
ubuntu-version: '2404'
47084856
- build-type: 'hipblas'
47094857
cuda-major-version: ""
47104858
cuda-minor-version: ""
@@ -5622,6 +5770,10 @@ includeDarwin:
56225770
tag-suffix: "-metal-darwin-arm64-qwen3-tts-cpp"
56235771
build-type: "metal"
56245772
lang: "go"
5773+
- backend: "moss-tts-cpp"
5774+
tag-suffix: "-metal-darwin-arm64-moss-tts-cpp"
5775+
build-type: "metal"
5776+
lang: "go"
56255777
- backend: "omnivoice-cpp"
56265778
tag-suffix: "-metal-darwin-arm64-omnivoice-cpp"
56275779
build-type: "metal"

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Disable parallel execution for backend builds
2-
.NOTPARALLEL: backends/diffusers backends/llama-cpp backends/turboquant backends/bonsai backends/outetts backends/piper backends/stablediffusion-ggml backends/whisper backends/crispasr backends/parakeet-cpp backends/moss-transcribe-cpp backends/faster-whisper backends/silero-vad backends/local-store backends/cloud-proxy backends/huggingface backends/rfdetr backends/rfdetr-cpp backends/insightface backends/speaker-recognition backends/kitten-tts backends/kokoro backends/chatterbox backends/llama-cpp-darwin backends/neutts build-darwin-python-backend build-darwin-go-backend backends/mlx backends/diffuser-darwin backends/mlx-vlm backends/mlx-audio backends/mlx-distributed backends/stablediffusion-ggml-darwin backends/vllm backends/vllm-omni backends/longcat-video backends/sglang backends/moonshine backends/pocket-tts backends/qwen-tts backends/faster-qwen3-tts backends/qwen-asr backends/nemo backends/voxcpm backends/whisperx backends/ace-step backends/acestep-cpp backends/fish-speech backends/voxtral backends/opus backends/trl backends/llama-cpp-quantization backends/kokoros backends/sam3-cpp backends/qwen3-tts-cpp backends/omnivoice-cpp backends/vibevoice-cpp backends/localvqe backends/tinygrad backends/sherpa-onnx backends/ds4 backends/ds4-darwin backends/liquid-audio backends/supertonic backends/depth-anything-cpp backends/privacy-filter backends/privacy-filter-darwin
2+
.NOTPARALLEL: backends/diffusers backends/llama-cpp backends/turboquant backends/bonsai backends/outetts backends/piper backends/stablediffusion-ggml backends/whisper backends/crispasr backends/parakeet-cpp backends/moss-transcribe-cpp backends/faster-whisper backends/silero-vad backends/local-store backends/cloud-proxy backends/huggingface backends/rfdetr backends/rfdetr-cpp backends/insightface backends/speaker-recognition backends/kitten-tts backends/kokoro backends/chatterbox backends/llama-cpp-darwin backends/neutts build-darwin-python-backend build-darwin-go-backend backends/mlx backends/diffuser-darwin backends/mlx-vlm backends/mlx-audio backends/mlx-distributed backends/stablediffusion-ggml-darwin backends/vllm backends/vllm-omni backends/longcat-video backends/sglang backends/moonshine backends/pocket-tts backends/qwen-tts backends/faster-qwen3-tts backends/qwen-asr backends/nemo backends/voxcpm backends/whisperx backends/ace-step backends/acestep-cpp backends/fish-speech backends/voxtral backends/opus backends/trl backends/llama-cpp-quantization backends/kokoros backends/sam3-cpp backends/qwen3-tts-cpp backends/moss-tts-cpp backends/omnivoice-cpp backends/vibevoice-cpp backends/localvqe backends/tinygrad backends/sherpa-onnx backends/ds4 backends/ds4-darwin backends/liquid-audio backends/supertonic backends/depth-anything-cpp backends/privacy-filter backends/privacy-filter-darwin
33

44
GOCMD=go
55
GOTEST=$(GOCMD) test
@@ -1249,6 +1249,7 @@ BACKEND_DEPTH_ANYTHING_CPP = depth-anything-cpp|golang|.|false|true
12491249
BACKEND_VOXTRAL = voxtral|golang|.|false|true
12501250
BACKEND_ACESTEP_CPP = acestep-cpp|golang|.|false|true
12511251
BACKEND_QWEN3_TTS_CPP = qwen3-tts-cpp|golang|.|false|true
1252+
BACKEND_MOSS_TTS_CPP = moss-tts-cpp|golang|.|false|true
12521253
BACKEND_OMNIVOICE_CPP = omnivoice-cpp|golang|.|false|true
12531254
BACKEND_VIBEVOICE_CPP = vibevoice-cpp|golang|.|false|true
12541255
BACKEND_LOCALVQE = localvqe|golang|.|false|true
@@ -1375,6 +1376,7 @@ $(eval $(call generate-docker-build-target,$(BACKEND_WHISPERX)))
13751376
$(eval $(call generate-docker-build-target,$(BACKEND_ACE_STEP)))
13761377
$(eval $(call generate-docker-build-target,$(BACKEND_ACESTEP_CPP)))
13771378
$(eval $(call generate-docker-build-target,$(BACKEND_QWEN3_TTS_CPP)))
1379+
$(eval $(call generate-docker-build-target,$(BACKEND_MOSS_TTS_CPP)))
13781380
$(eval $(call generate-docker-build-target,$(BACKEND_OMNIVOICE_CPP)))
13791381
$(eval $(call generate-docker-build-target,$(BACKEND_VIBEVOICE_CPP)))
13801382
$(eval $(call generate-docker-build-target,$(BACKEND_LOCALVQE)))
@@ -1394,7 +1396,7 @@ $(eval $(call generate-docker-build-target,$(BACKEND_SUPERTONIC)))
13941396
docker-save-%: backend-images
13951397
docker save local-ai-backend:$* -o backend-images/$*.tar
13961398

1397-
docker-build-backends: docker-build-llama-cpp docker-build-ik-llama-cpp docker-build-turboquant docker-build-bonsai docker-build-ds4 docker-build-rerankers docker-build-vllm docker-build-vllm-omni docker-build-longcat-video docker-build-sglang docker-build-transformers docker-build-outetts docker-build-diffusers docker-build-kokoro docker-build-faster-whisper docker-build-crispasr docker-build-coqui docker-build-chatterbox docker-build-vibevoice docker-build-liquid-audio docker-build-moonshine docker-build-pocket-tts docker-build-qwen-tts docker-build-fish-speech docker-build-faster-qwen3-tts docker-build-qwen-asr docker-build-nemo docker-build-voxcpm docker-build-whisperx docker-build-ace-step docker-build-acestep-cpp docker-build-voxtral docker-build-mlx-distributed docker-build-trl docker-build-llama-cpp-quantization docker-build-tinygrad docker-build-kokoros docker-build-sam3-cpp docker-build-rfdetr-cpp docker-build-qwen3-tts-cpp docker-build-omnivoice-cpp docker-build-vibevoice-cpp docker-build-localvqe docker-build-insightface docker-build-speaker-recognition docker-build-sherpa-onnx docker-build-cloud-proxy docker-build-supertonic docker-build-depth-anything-cpp docker-build-moss-transcribe-cpp docker-build-privacy-filter
1399+
docker-build-backends: docker-build-llama-cpp docker-build-ik-llama-cpp docker-build-turboquant docker-build-bonsai docker-build-ds4 docker-build-rerankers docker-build-vllm docker-build-vllm-omni docker-build-longcat-video docker-build-sglang docker-build-transformers docker-build-outetts docker-build-diffusers docker-build-kokoro docker-build-faster-whisper docker-build-crispasr docker-build-coqui docker-build-chatterbox docker-build-vibevoice docker-build-liquid-audio docker-build-moonshine docker-build-pocket-tts docker-build-qwen-tts docker-build-fish-speech docker-build-faster-qwen3-tts docker-build-qwen-asr docker-build-nemo docker-build-voxcpm docker-build-whisperx docker-build-ace-step docker-build-acestep-cpp docker-build-voxtral docker-build-mlx-distributed docker-build-trl docker-build-llama-cpp-quantization docker-build-tinygrad docker-build-kokoros docker-build-sam3-cpp docker-build-rfdetr-cpp docker-build-qwen3-tts-cpp docker-build-moss-tts-cpp docker-build-omnivoice-cpp docker-build-vibevoice-cpp docker-build-localvqe docker-build-insightface docker-build-speaker-recognition docker-build-sherpa-onnx docker-build-cloud-proxy docker-build-supertonic docker-build-depth-anything-cpp docker-build-moss-transcribe-cpp docker-build-privacy-filter
13981400

13991401
########################################################
14001402
### Mock Backend for E2E Tests

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ Most backends wrap a best-in-class upstream engine. A handful of them are native
233233
|---------|-------------|
234234
| [parakeet.cpp](https://github.com/mudler/parakeet.cpp) | C++/GGML port of NVIDIA NeMo Parakeet ASR (tdt/ctc/rnnt/hybrid), with cache-aware streaming transcription |
235235
| [moss-transcribe.cpp](https://github.com/mudler/moss-transcribe.cpp) | C++/GGML port of OpenMOSS MOSS-Transcribe-Diarize: joint long-form transcription, speaker diarization and timestamping in a single pass |
236+
| [moss-tts.cpp](https://github.com/mudler/moss-tts.cpp) | C++/GGML port of the OpenMOSS MOSS-TTS family: text-to-speech (MOSS-TTS-Local v1.5, 48 kHz stereo) with reference-audio voice cloning, through the MOSS-Audio-Tokenizer neural codec |
236237
| [ced.cpp](https://github.com/mudler/ced.cpp) | C++/GGML port of the CED audio-tagging models: sound-event classification (527-class AudioSet) over REST and the realtime API for live recognition |
237238
| [voice-detect.cpp](https://github.com/mudler/voice-detect.cpp) | Speaker recognition and voice analysis (ECAPA-TDNN, WeSpeaker, ERes2Net, CAM++, wav2vec2 age/gender/emotion), replacing the Python speaker-recognition backend |
238239
| [voxtral-tts.c](https://github.com/mudler/voxtral-tts.c) | Voxtral Realtime 4B speech-to-text in pure C |

backend/go/moss-tts-cpp/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
moss-tts-cpp
2+
*.so
3+
*.dylib
4+
sources/
5+
package/
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
project(gomosstts-cpp LANGUAGES C CXX)
3+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
4+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
5+
6+
set(MOSS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sources/moss-tts.cpp)
7+
8+
# Override upstream's CMAKE_CUDA_ARCHITECTURES before add_subdirectory.
9+
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
10+
set(CMAKE_CUDA_ARCHITECTURES "75-virtual;80-virtual;86-real;89-real")
11+
endif()
12+
13+
# Add the upstream project. Its own CMakeLists vendors ggml under
14+
# third_party/ggml and builds the moss-tts library (STATIC by default, since we
15+
# do NOT set MOSS_TTS_SHARED). EXCLUDE_FROM_ALL keeps its CLI tool / tests /
16+
# examples from building unless referenced.
17+
add_subdirectory(${MOSS_DIR} mosstts EXCLUDE_FROM_ALL)
18+
19+
add_library(gomosstts-cpp MODULE cpp/mossttscpp.cpp)
20+
target_link_libraries(gomosstts-cpp PRIVATE moss-tts)
21+
22+
target_include_directories(gomosstts-cpp PRIVATE ${MOSS_DIR}/include ${MOSS_DIR}/src)
23+
target_include_directories(gomosstts-cpp SYSTEM PRIVATE ${MOSS_DIR}/third_party/ggml/include)
24+
25+
# Link GPU backends if the upstream ggml created them. moss-tts links these
26+
# PUBLIC when enabled, but we re-list them so the MODULE carries the symbols
27+
# even under static ggml (mirrors qwen3-tts-cpp).
28+
foreach(backend blas cuda hip metal vulkan sycl)
29+
if(TARGET ggml-${backend})
30+
target_link_libraries(gomosstts-cpp PRIVATE ggml-${backend})
31+
if(backend STREQUAL "cuda")
32+
find_package(CUDAToolkit QUIET)
33+
if(CUDAToolkit_FOUND)
34+
target_link_libraries(gomosstts-cpp PRIVATE CUDA::cudart)
35+
endif()
36+
endif()
37+
endif()
38+
endforeach()
39+
40+
if(MSVC)
41+
target_compile_options(gomosstts-cpp PRIVATE /W4 /wd4100 /wd4505)
42+
else()
43+
target_compile_options(gomosstts-cpp PRIVATE -Wall -Wextra
44+
-Wno-unused-parameter -Wno-unused-function)
45+
endif()
46+
47+
set_property(TARGET gomosstts-cpp PROPERTY CXX_STANDARD 17)
48+
set_target_properties(gomosstts-cpp PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

0 commit comments

Comments
 (0)