| target_link_libraries( | target_link_libraries( | ||||
| espeak-ng-bin PRIVATE espeak-ng espeak-ng-config | espeak-ng-bin PRIVATE espeak-ng espeak-ng-config | ||||
| ) | ) | ||||
| if (MINGW) | |||||
| target_link_options(espeak-ng-bin PRIVATE "-static-libstdc++" "-static") | |||||
| endif() | |||||
| if (MSVC) | if (MSVC) | ||||
| target_sources(espeak-ng-bin PRIVATE compat/getopt.c) | target_sources(espeak-ng-bin PRIVATE compat/getopt.c) | ||||
| endif() | endif() |
| endif() | endif() | ||||
| target_link_libraries(espeak-ng PUBLIC espeak-include) | target_link_libraries(espeak-ng PUBLIC espeak-include) | ||||
| if ((MINGW OR WIN32 OR MSVC) AND BUILD_SHARED_LIBS) | |||||
| set_target_properties(espeak-ng PROPERTIES | |||||
| RUNTIME_OUTPUT_DIRECTORY .. | |||||
| ) | |||||
| endif() | |||||
| if (MINGW) | |||||
| target_link_options(espeak-ng PRIVATE "-static-libstdc++" "-static") | |||||
| endif() | |||||
| install(TARGETS espeak-ng LIBRARY) | install(TARGETS espeak-ng LIBRARY) |
| target_link_libraries(test_${_test_name} PRIVATE | target_link_libraries(test_${_test_name} PRIVATE | ||||
| $<TARGET_PROPERTY:espeak-ng,LINK_LIBRARIES> | $<TARGET_PROPERTY:espeak-ng,LINK_LIBRARIES> | ||||
| ) | ) | ||||
| target_compile_definitions(test_${_test_name} PRIVATE LIBESPEAK_NG_EXPORT=1) | |||||
| target_include_directories( | target_include_directories( | ||||
| test_${_test_name} PRIVATE | test_${_test_name} PRIVATE | ||||
| $<TARGET_PROPERTY:espeak-ng,SOURCE_DIR> | $<TARGET_PROPERTY:espeak-ng,SOURCE_DIR> | ||||
| $<TARGET_PROPERTY:espeak-ng,INTERFACE_INCLUDE_DIRECTORIES> | $<TARGET_PROPERTY:espeak-ng,INTERFACE_INCLUDE_DIRECTORIES> | ||||
| $<TARGET_PROPERTY:espeak-ng-config,INTERFACE_INCLUDE_DIRECTORIES> | $<TARGET_PROPERTY:espeak-ng-config,INTERFACE_INCLUDE_DIRECTORIES> | ||||
| ) | ) | ||||
| if (MINGW) | |||||
| target_link_options(test_${_test_name} PUBLIC "-static" "-static-libstdc++") | |||||
| endif() | |||||
| add_dependencies(test_${_test_name} data) | add_dependencies(test_${_test_name} data) | ||||
| add_test( | add_test( | ||||
| NAME ${_test_name} | NAME ${_test_name} |
| (void)argc; // unused parameter | (void)argc; // unused parameter | ||||
| char *progdir = strdup(argv[0]); | char *progdir = strdup(argv[0]); | ||||
| char *dir = strrchr(progdir, '/'); | |||||
| char *dir = strrchr(progdir, PATHSEP); | |||||
| if (dir != NULL) *dir = 0; | if (dir != NULL) *dir = 0; | ||||
| test_espeak_terminate_without_initialize(); | test_espeak_terminate_without_initialize(); |