summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-11-14 21:03:35 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-11-14 21:04:03 +0100
commitc54fd03e50e2d93e3250584f2d65049fbbaf75f6 (patch)
treea260f5af883a0615d22209f7e2162731ab63bf43
parentdb632015be44c31341e8ab002e8c3f0cb3727edb (diff)
downloadlibssh-c54fd03e50e2d93e3250584f2d65049fbbaf75f6.tar.gz
libssh-c54fd03e50e2d93e3250584f2d65049fbbaf75f6.tar.xz
libssh-c54fd03e50e2d93e3250584f2d65049fbbaf75f6.zip
cmake: Fix building libssh as a static lib on Windows
Fixes T198 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
-rw-r--r--src/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 804aa41f..30629db0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -322,6 +322,10 @@ target_include_directories(ssh
target_link_libraries(ssh
PRIVATE ${LIBSSH_LINK_LIBRARIES})
+if (WIN32 AND NOT BUILD_SHARED_LIBS)
+ set_target_properties(ssh PROPERTIES COMPILE_FLAGS "-DLIBSSH_STATIC")
+endif ()
+
add_library(ssh::ssh ALIAS ssh)
if (WITH_SYMBOL_VERSIONING AND HAVE_LD_VERSION_SCRIPT)