| @@ -0,0 +1,21 @@ | |||
| name: Windows | |||
| on: | |||
| workflow_dispatch: | |||
| push: | |||
| branches: [ master ] | |||
| pull_request: | |||
| branches: [ master ] | |||
| jobs: | |||
| build: | |||
| runs-on: windows-latest | |||
| name: build | |||
| steps: | |||
| - uses: actions/checkout@v3 | |||
| - name: configure | |||
| run: cmake -Bbuild -DUSE_ASYNC:BOOL=OFF | |||
| - name: make | |||
| run: cmake --build build | |||
| - name: make check | |||
| run: ctest --test-dir build -Ttest -C Debug -j1 --output-on-failure | |||
| @@ -7,4 +7,8 @@ option(USE_LIBPCAUDIO "Use libPcAudio for sound output" ${HAVE_LIBPCAUDIO}) | |||
| option(USE_KLATT "Use klatt for speech synthesis" ON) | |||
| option(USE_SPEECHPLAYER "Use speech-player for speech synthesis" ON) | |||
| option(USE_ASYNC "Support asynchronous speech synthesis" ON) | |||
| if (HAVE_PTHREAD) | |||
| option(USE_ASYNC "Support asynchronous speech synthesis" ON) | |||
| else() | |||
| set(USE_ASYNC OFF) | |||
| endif() | |||
| @@ -10,11 +10,16 @@ set_target_properties(espeak-ng-bin PROPERTIES OUTPUT_NAME espeak-ng) | |||
| target_link_libraries( | |||
| espeak-ng-bin PRIVATE espeak-ng espeak-ng-config | |||
| ) | |||
| add_custom_target( | |||
| speak-ng ALL | |||
| ${CMAKE_COMMAND} -E create_symlink espeak-ng ${CMAKE_CURRENT_BINARY_DIR}/speak-ng | |||
| COMMENT "Link espeak-ng to speak-ng" | |||
| DEPENDS espeak-ng-bin | |||
| ) | |||
| if (MSVC) | |||
| target_sources(espeak-ng-bin PRIVATE compat/getopt.c) | |||
| endif() | |||
| if (NOT WIN32) | |||
| add_custom_target( | |||
| speak-ng ALL | |||
| ${CMAKE_COMMAND} -E create_symlink espeak-ng ${CMAKE_CURRENT_BINARY_DIR}/speak-ng | |||
| COMMENT "Link espeak-ng to speak-ng" | |||
| DEPENDS espeak-ng-bin | |||
| ) | |||
| endif() | |||
| install(TARGETS espeak-ng-bin) | |||
| install(DIRECTORY include/espeak include/espeak-ng TYPE INCLUDE) | |||
| @@ -38,23 +38,28 @@ add_library(espeak-ng | |||
| espeak_api.c | |||
| ) | |||
| target_compile_options(espeak-ng PRIVATE | |||
| "-fPIC" | |||
| "-fvisibility=hidden" | |||
| "-fno-exceptions" | |||
| "-fwrapv" | |||
| "-pedantic" | |||
| "-Wunused-parameter" | |||
| "-Wunused" | |||
| "-Wuninitialized" | |||
| "-Wreturn-type" | |||
| "-Wmissing-prototypes" | |||
| "-Wint-conversion" | |||
| "-Wimplicit" | |||
| ) | |||
| target_compile_definitions(espeak-ng PRIVATE "LIBESPEAK_NG_EXPORT") | |||
| if (NOT MSVC) | |||
| target_compile_options(espeak-ng PRIVATE | |||
| "-fPIC" | |||
| "-fvisibility=hidden" | |||
| "-fno-exceptions" | |||
| "-fwrapv" | |||
| "-pedantic" | |||
| "-Wunused-parameter" | |||
| "-Wunused" | |||
| "-Wuninitialized" | |||
| "-Wreturn-type" | |||
| "-Wmissing-prototypes" | |||
| "-Wint-conversion" | |||
| "-Wimplicit" | |||
| ) | |||
| endif() | |||
| target_compile_definitions(espeak-ng PRIVATE "LIBESPEAK_NG_EXPORT=1") | |||
| if (NOT BUILD_SHARED_LIBS) | |||
| target_compile_definitions(espeak-ng INTERFACE "LIBESPEAK_NG_EXPORT=1") | |||
| endif() | |||
| if (USE_ASYNC) | |||
| target_sources(espeak-ng PRIVATE | |||
| @@ -91,7 +96,10 @@ if (HAVE_LIBPCAUDIO AND USE_LIBPCAUDIO) | |||
| target_include_directories(espeak-ng PRIVATE ${PCAUDIO_INC}) | |||
| endif() | |||
| target_link_libraries(espeak-ng PRIVATE espeak-ng-config ucd m) | |||
| target_link_libraries(espeak-ng PRIVATE espeak-ng-config ucd) | |||
| if (NOT MSVC) | |||
| target_link_libraries(espeak-ng PRIVATE m) | |||
| endif() | |||
| target_link_libraries(espeak-ng PUBLIC espeak-include) | |||
| install(TARGETS espeak-ng LIBRARY) | |||
| @@ -4,5 +4,7 @@ add_library(speechPlayer STATIC | |||
| src/speechWaveGenerator.cpp | |||
| ) | |||
| target_include_directories(speechPlayer PUBLIC include) | |||
| target_compile_options(speechPlayer PRIVATE "-fPIC") | |||
| if(NOT MSVC) | |||
| target_compile_options(speechPlayer PRIVATE "-fPIC") | |||
| endif() | |||
| install(TARGETS speechPlayer ARCHIVE) | |||