mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-05 08:00:36 +00:00
Windows: bunch of build fixes with CMake (#1585)
This commit is contained in:
@@ -10,6 +10,9 @@ set_target_properties(espeak-ng-bin PROPERTIES OUTPUT_NAME espeak-ng)
|
|||||||
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()
|
||||||
|
|||||||
@@ -102,4 +102,14 @@ if (NOT MSVC)
|
|||||||
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)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ macro(compiled_test _test_name)
|
|||||||
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>
|
||||||
@@ -17,6 +18,9 @@ macro(compiled_test _test_name)
|
|||||||
$<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}
|
||||||
|
|||||||
+1
-1
@@ -630,7 +630,7 @@ main(int argc, char **argv)
|
|||||||
(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();
|
||||||
|
|||||||
Reference in New Issue
Block a user