Fix for iOS

This commit is contained in:
Fangjun Kuang
2023-11-27 21:43:59 +08:00
parent d112cebb1a
commit 6bfc5c8d6b
3 changed files with 33 additions and 28 deletions
+5 -2
View File
@@ -6,12 +6,15 @@ project(espeak-ng
HOMEPAGE_URL "https://github.com/espeak-ng/espeak-ng" HOMEPAGE_URL "https://github.com/espeak-ng/espeak-ng"
) )
option(BUILD_ESPEAK_NG_EXE "Whether to build espeak-ng-bin" ON)
option(BUILD_ESPEAK_NG_TESTS "Whether to build tests" ON)
include(CTest) include(CTest)
include(cmake/deps.cmake) include(cmake/deps.cmake)
include(cmake/config.cmake) include(cmake/config.cmake)
add_subdirectory(src) add_subdirectory(src)
if(NOT CMAKE_CROSSCOMPILING) if(BUILD_ESPEAK_NG_EXE)
include(cmake/data.cmake) include(cmake/data.cmake)
endif() endif()
include(cmake/docs.cmake) include(cmake/docs.cmake)
@@ -19,7 +22,7 @@ include(cmake/docs.cmake)
include(cmake/package.cmake) include(cmake/package.cmake)
include(CPack) include(CPack)
if(NOT CMAKE_CROSSCOMPILING) if(BUILD_ESPEAK_NG_TESTS)
include(CTest) include(CTest)
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()
+27 -25
View File
@@ -5,31 +5,33 @@ add_subdirectory(ucd-tools)
add_subdirectory(speechPlayer) add_subdirectory(speechPlayer)
add_subdirectory(libespeak-ng) add_subdirectory(libespeak-ng)
add_executable(espeak-ng-bin espeak-ng.c) if(BUILD_ESPEAK_NG_EXE)
target_link_libraries( add_executable(espeak-ng-bin espeak-ng.c)
espeak-ng-bin PRIVATE espeak-ng espeak-ng-config target_link_libraries(
) espeak-ng-bin PRIVATE espeak-ng espeak-ng-config
if (MINGW)
target_link_options(espeak-ng-bin PRIVATE "-static-libstdc++" "-static")
endif()
if (MSVC)
target_sources(espeak-ng-bin PRIVATE compat/getopt.c)
endif()
if (NOT WIN32)
add_custom_target(
speak-ng ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink espeak-ng ${CMAKE_CURRENT_BINARY_DIR}/speak-ng
COMMAND ${CMAKE_COMMAND} -E create_symlink espeak-ng ${CMAKE_CURRENT_BINARY_DIR}/espeak
COMMAND ${CMAKE_COMMAND} -E create_symlink espeak-ng ${CMAKE_CURRENT_BINARY_DIR}/speak
COMMENT "Link espeak-ng to compat names"
DEPENDS espeak-ng-bin
) )
endif() if (MINGW)
install(TARGETS espeak-ng-bin) target_link_options(espeak-ng-bin PRIVATE "-static-libstdc++" "-static")
install(DIRECTORY include/espeak include/espeak-ng TYPE INCLUDE) endif()
if (MSVC)
target_sources(espeak-ng-bin PRIVATE compat/getopt.c)
endif()
if (NOT WIN32)
add_custom_target(
speak-ng ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink espeak-ng ${CMAKE_CURRENT_BINARY_DIR}/speak-ng
COMMAND ${CMAKE_COMMAND} -E create_symlink espeak-ng ${CMAKE_CURRENT_BINARY_DIR}/espeak
COMMAND ${CMAKE_COMMAND} -E create_symlink espeak-ng ${CMAKE_CURRENT_BINARY_DIR}/speak
COMMENT "Link espeak-ng to compat names"
DEPENDS espeak-ng-bin
)
endif()
install(TARGETS espeak-ng-bin)
install(DIRECTORY include/espeak include/espeak-ng TYPE INCLUDE)
if (ESPEAK_COMPAT AND NOT WIN32) if (ESPEAK_COMPAT AND NOT WIN32)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/speak-ng DESTINATION bin) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/speak-ng DESTINATION bin)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/espeak DESTINATION bin) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/espeak DESTINATION bin)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/speak DESTINATION bin) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/speak DESTINATION bin)
endif()
endif() endif()
+1 -1
View File
@@ -20,7 +20,7 @@
#define ENDIAN_H_COMPAT_SHIM #define ENDIAN_H_COMPAT_SHIM
#pragma once #pragma once
#if __has_include_next(<endian.h>) #if __has_include_next(<endian.h>) && !defined(__APPLE__)
# pragma GCC system_header // Silence "warning: #include_next is a GCC extension" # pragma GCC system_header // Silence "warning: #include_next is a GCC extension"
# include_next <endian.h> # include_next <endian.h>
#elif __has_include(<sys/endian.h>) #elif __has_include(<sys/endian.h>)