diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2019-11-14 21:03:35 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-11-14 21:04:03 +0100 |
commit | c54fd03e50e2d93e3250584f2d65049fbbaf75f6 (patch) | |
tree | a260f5af883a0615d22209f7e2162731ab63bf43 /src/CMakeLists.txt | |
parent | db632015be44c31341e8ab002e8c3f0cb3727edb (diff) | |
download | libssh-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>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 4 |
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) |