voice_audio_multi/tools/cmake/espeak_patch.cmake
Fabio c36510c21e
Some checks failed
Linux Build / Linux cpu (push) Has been cancelled
Linux Build / Linux cpu-clang (push) Has been cancelled
Linux Build / Linux vulkan (push) Has been cancelled
mac-build / macOS CPU (push) Has been cancelled
Nix Build / Nix (cpu) (push) Has been cancelled
Nix Build / Nix (vulkan) (push) Has been cancelled
windows-build / Windows CPU (push) Has been cancelled
Initial import: audio.cpp with Orange Pi documentation
2026-11-04 19:05:22 +01:00

22 lines
1.2 KiB
CMake

# Upstream 1.52 fetches Sonic even when USE_LIBSONIC=OFF. Respect that option
# so a phonemizer-only build has no unnecessary transitive network dependency.
set(path "${SOURCE_DIR}/cmake/deps.cmake")
file(READ "${path}" contents)
string(REPLACE "else()\n FetchContent_Declare(sonic-git" "elseif(USE_LIBSONIC)\n FetchContent_Declare(sonic-git" contents "${contents}")
file(WRITE "${path}" "${contents}")
set(path "${SOURCE_DIR}/src/CMakeLists.txt")
file(READ "${path}" contents)
if(NOT contents MATCHES "ARCHIVE_OUTPUT_NAME espeak-ng-tool")
string(APPEND contents "\n# Avoid colliding with the static espeak-ng library on MSVC.\nset_target_properties(espeak-ng-bin PROPERTIES ARCHIVE_OUTPUT_NAME espeak-ng-tool)\n")
file(WRITE "${path}" "${contents}")
endif()
if(BROWSER_BUILD)
# Musl's wchar.h declares isw* too. Include it before eSpeak redirects those
# names to UCD, so the macros do not rewrite libc function declarations.
set(path "${SOURCE_DIR}/src/include/compat/wctype.h")
file(READ "${path}" contents)
if(NOT contents MATCHES "#include <wchar.h>")
string(REPLACE "#include <ucd/ucd.h>" "#include <ucd/ucd.h>\n#include <wchar.h>" contents "${contents}")
file(WRITE "${path}" "${contents}")
endif()
endif()