File size: 1,292 Bytes
5eee449
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
cmake_minimum_required(VERSION 3.16)
project(inflect_tts_sdk CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE Release)
endif()

# Root of the AXera BSP runtime (contains include/ with ax_engine_api.h,
# ax_sys_api.h and lib/ with libax_engine.so, libax_sys.so). Leave empty for a
# host configure/build check — the engine wrapper compiles to a throwing stub.
set(AX_RUNTIME_ROOT "" CACHE PATH "AX BSP runtime root (include/ + lib/)")

add_library(inflect_tts STATIC
  src/inflect_tts.cpp
  src/host_chain.cpp
  src/ax_runner.cpp
  src/wav_writer.cpp
)
target_include_directories(inflect_tts PUBLIC src)

if(AX_RUNTIME_ROOT)
  target_compile_definitions(inflect_tts PRIVATE INFLECT_WITH_AX_ENGINE=1)
  target_include_directories(inflect_tts PRIVATE ${AX_RUNTIME_ROOT}/include)
  target_link_directories(inflect_tts PUBLIC ${AX_RUNTIME_ROOT}/lib)
  target_link_libraries(inflect_tts PUBLIC ax_engine ax_sys)
  message(STATUS "inflect_tts: AX runtime from ${AX_RUNTIME_ROOT}")
else()
  message(STATUS "inflect_tts: AX_RUNTIME_ROOT not set — building host stub (no NPU runtime)")
endif()

add_executable(inflect_tts_cli src/main.cpp)
target_link_libraries(inflect_tts_cli PRIVATE inflect_tts)