1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

cmake: Fix linking shared and static libraries

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Andreas Schneider
2019-07-06 17:07:23 +02:00
parent 2884f97bc5
commit 915c006a30

View File

@@ -319,7 +319,8 @@ target_compile_options(${LIBSSH_SHARED_LIBRARY}
${DEFAULT_C_COMPILE_FLAGS}
-D_GNU_SOURCE)
target_link_libraries(${LIBSSH_SHARED_LIBRARY} ${LIBSSH_LINK_LIBRARIES})
target_link_libraries(${LIBSSH_SHARED_LIBRARY}
PRIVATE ${LIBSSH_LINK_LIBRARIES})
if (WITH_SYMBOL_VERSIONING AND HAVE_LD_VERSION_SCRIPT)
if (ABIMAP_FOUND)
@@ -371,6 +372,9 @@ if (BUILD_STATIC_LIB)
${DEFAULT_C_COMPILE_FLAGS}
-D_GNU_SOURCE)
target_link_libraries(${LIBSSH_STATIC_LIBRARY}
PUBLIC ${LIBSSH_LINK_LIBRARIES})
if (MSVC)
set(OUTPUT_SUFFIX static)
else (MSVC)