# Builds Python module for Piper using espeak-ng and cmake.
#
# This is called automatically by scikit-build from setup.py.
cmake_minimum_required(VERSION 3.26)
project(piper LANGUAGES C CXX)

# scikit-build-core will forward Python_* variables
find_package(Python3 COMPONENTS Development.Module Development.Embed Development.SABIModule REQUIRED)

# espeak bridge
add_library(espeakbridge MODULE
    src/piper/espeakbridge.c
)

target_link_libraries(espeakbridge
    -lespeak-ng
    Python3::SABIModule
    Python3::Module
    Python3::Python
)

install(TARGETS espeakbridge
    LIBRARY DESTINATION .
    RUNTIME DESTINATION .
)

