diff options
author | Andreas Schneider <asn@cynapses.org> | 2010-12-10 20:02:15 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cynapses.org> | 2010-12-10 20:02:15 +0100 |
commit | 57d752a1c31d64ef197444d6bf8f1f2726776661 (patch) | |
tree | 5daead8cca98ed15c7a79a92a8c8c94088c3b87f | |
parent | ef1cfbea70be15ec318e97e2293b6466b7032fbc (diff) | |
download | libssh-57d752a1c31d64ef197444d6bf8f1f2726776661.tar.gz libssh-57d752a1c31d64ef197444d6bf8f1f2726776661.tar.xz libssh-57d752a1c31d64ef197444d6bf8f1f2726776661.zip |
include: Only require LIBSSH_STATIC on Windows.
-rw-r--r-- | include/libssh/libssh.h | 18 | ||||
-rw-r--r-- | src/CMakeLists.txt | 11 |
2 files changed, 18 insertions, 11 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index e0db20e..21ab70e 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -22,10 +22,10 @@ #ifndef _LIBSSH_H #define _LIBSSH_H -#ifdef LIBSSH_STATIC - #define LIBSSH_API -#else - #if defined _WIN32 || defined __CYGWIN__ +#if defined _WIN32 || defined __CYGWIN__ + #ifdef LIBSSH_STATIC + #define LIBSSH_API + #else #ifdef LIBSSH_EXPORTS #ifdef __GNUC__ #define LIBSSH_API __attribute__((dllexport)) @@ -39,12 +39,12 @@ #define LIBSSH_API __declspec(dllimport) #endif #endif + #endif +#else + #if __GNUC__ >= 4 + #define LIBSSH_API __attribute__((visibility("default"))) #else - #if __GNUC__ >= 4 - #define LIBSSH_API __attribute__((visibility("default"))) - #else - #define LIBSSH_API - #endif + #define LIBSSH_API #endif #endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e8516f0..ab6c4e7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -190,10 +190,17 @@ if (WITH_STATIC_LIB) ${LIBRARY_SOVERSION} OUTPUT_NAME ssh - COMPILE_FLAGS - "-DLIBSSH_STATIC" ) + if (WIN32) + set_target_properties( + ${LIBSSH_STATIC_LIBRARY} + PROPERTIES + COMPILE_FLAGS + "-DLIBSSH_STATIC" + ) + endif (WIN32) + install( TARGETS ${LIBSSH_STATIC_LIBRARY} |