summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/libssh/libssh.h32
-rw-r--r--libssh/CMakeLists.txt10
2 files changed, 21 insertions, 21 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index 9a6b9f8..cf2ab16 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -22,26 +22,30 @@
#ifndef _LIBSSH_H
#define _LIBSSH_H
-#if defined _WIN32 || defined __CYGWIN__
- #ifdef SSH_EXPORTS
- #ifdef __GNUC__
- #define LIBSSH_API __attribute__((dllexport))
+#ifdef LIBSSH_STATIC
+ #define LIBSSH_API
+#else
+ #if defined _WIN32 || defined __CYGWIN__
+ #ifdef LIBSSH_EXPORTS
+ #ifdef __GNUC__
+ #define LIBSSH_API __attribute__((dllexport))
+ #else
+ #define LIBSSH_API __declspec(dllexport)
+ #endif
#else
- #define LIBSSH_API __declspec(dllexport)
+ #ifdef __GNUC__
+ #define LIBSSH_API __attribute__((dllimport))
+ #else
+ #define LIBSSH_API __declspec(dllimport)
+ #endif
#endif
#else
- #ifdef __GNUC__
- #define LIBSSH_API __attribute__((dllimport))
+ #if __GNUC__ >= 4
+ #define LIBSSH_API __attribute__((visibility("default")))
#else
- #define LIBSSH_API __declspec(dllimport)
+ #define LIBSSH_API
#endif
#endif
-#else
- #if __GNUC__ >= 4
- #define LIBSSH_API __attribute__((visibility("default")))
- #else
- #define LIBSSH_API
- #endif
#endif
#ifdef _MSC_VER
diff --git a/libssh/CMakeLists.txt b/libssh/CMakeLists.txt
index 3af8d8a..9274f6f 100644
--- a/libssh/CMakeLists.txt
+++ b/libssh/CMakeLists.txt
@@ -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(