| 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 |
| option(USE_KLATT "Use klatt for speech synthesis" ON) | option(USE_KLATT "Use klatt for speech synthesis" ON) | ||||
| option(USE_SPEECHPLAYER "Use speech-player 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() |
| target_link_libraries( | target_link_libraries( | ||||
| espeak-ng-bin PRIVATE espeak-ng espeak-ng-config | 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(TARGETS espeak-ng-bin) | ||||
| install(DIRECTORY include/espeak include/espeak-ng TYPE INCLUDE) | install(DIRECTORY include/espeak include/espeak-ng TYPE INCLUDE) |
| espeak_api.c | 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) | if (USE_ASYNC) | ||||
| target_sources(espeak-ng PRIVATE | target_sources(espeak-ng PRIVATE | ||||
| target_include_directories(espeak-ng PRIVATE ${PCAUDIO_INC}) | target_include_directories(espeak-ng PRIVATE ${PCAUDIO_INC}) | ||||
| endif() | 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) | target_link_libraries(espeak-ng PUBLIC espeak-include) | ||||
| install(TARGETS espeak-ng LIBRARY) | install(TARGETS espeak-ng LIBRARY) |
| src/speechWaveGenerator.cpp | src/speechWaveGenerator.cpp | ||||
| ) | ) | ||||
| target_include_directories(speechPlayer PUBLIC include) | 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) | install(TARGETS speechPlayer ARCHIVE) |