mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-27 13:21:11 +03:00
Fix static build.
If you want to link against the static library you have to define LIBSSH_STATIC and link against ssh_static. gcc -static -DLIBSSH_STATIC -lssh_static foo.c -o foo
This commit is contained in:
@@ -22,8 +22,11 @@
|
||||
#ifndef _LIBSSH_H
|
||||
#define _LIBSSH_H
|
||||
|
||||
#ifdef LIBSSH_STATIC
|
||||
#define LIBSSH_API
|
||||
#else
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#ifdef SSH_EXPORTS
|
||||
#ifdef LIBSSH_EXPORTS
|
||||
#ifdef __GNUC__
|
||||
#define LIBSSH_API __attribute__((dllexport))
|
||||
#else
|
||||
@@ -43,6 +46,7 @@
|
||||
#define LIBSSH_API
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* Visual Studio hasn't inttypes.h so it doesn't know uint32_t */
|
||||
|
||||
@@ -156,10 +156,8 @@ set_target_properties(
|
||||
${LIBRARY_SOVERSION}
|
||||
OUTPUT_NAME
|
||||
ssh
|
||||
CLEAN_DIRECT_OUTPUT
|
||||
1
|
||||
DEFINE_SYMBOL
|
||||
SSH_EXPORTS
|
||||
LIBSSH_EXPORTS
|
||||
COMPILE_FLAGS
|
||||
${LIBSSH_SHARED_CFLAGS}
|
||||
)
|
||||
@@ -183,10 +181,8 @@ if (WITH_STATIC_LIB)
|
||||
${LIBRARY_VERSION}
|
||||
SOVERSION
|
||||
${LIBRARY_SOVERSION}
|
||||
OUTPUT_NAME
|
||||
ssh
|
||||
CLEAN_DIRECT_OUTPUT
|
||||
1
|
||||
COMPILE_FLAGS
|
||||
"-DLIBSSH_STATIC"
|
||||
)
|
||||
|
||||
install(
|
||||
|
||||
Reference in New Issue
Block a user