windows: fix mingw build

This commit is contained in:
Yury Popov
2022-12-09 00:49:31 +03:00
parent 91b3959170
commit 6bb25fbb07
3 changed files with 10 additions and 0 deletions
+3
View File
@@ -10,6 +10,9 @@ set_target_properties(espeak-ng-bin PROPERTIES OUTPUT_NAME espeak-ng)
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()
+4
View File
@@ -108,4 +108,8 @@ if ((MINGW OR WIN32 OR MSVC) AND BUILD_SHARED_LIBS)
)
endif()
if (MINGW)
target_link_options(espeak-ng PRIVATE "-static-libstdc++" "-static")
endif()
install(TARGETS espeak-ng LIBRARY)
+3
View File
@@ -18,6 +18,9 @@ macro(compiled_test _test_name)
$<TARGET_PROPERTY:espeak-ng,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_test(
NAME ${_test_name}