From c1c4f299ff8881fe0c8d51790d49bfb5fcd632df Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 27 Apr 2009 10:58:29 +0000 Subject: Add option to build with or without sftp support. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@618 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/CMakeLists.txt | 16 ++++++++++++++-- libssh/sftp.c | 5 +++-- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'libssh') diff --git a/libssh/CMakeLists.txt b/libssh/CMakeLists.txt index e3ee26b..260d743 100644 --- a/libssh/CMakeLists.txt +++ b/libssh/CMakeLists.txt @@ -85,13 +85,25 @@ set(libssh_SRCS options.c packet.c session.c - sftp.c - sftpserver.c socket.c string.c wrapper.c ) +if (WITH_SFTP) + set(libssh_SRCS + ${libssh_SRCS} + sftp.c + ) + + if (WITH_SERVER) + set(libssh_SRCS + ${libssh_SRCS} + sftpserver.c + ) + endif (WITH_SERVER) +endif (WITH_SFTP) + if (WITH_SSH1) set(libssh_SRCS ${libssh_SRCS} diff --git a/libssh/sftp.c b/libssh/sftp.c index a32b1cc..55dd93f 100644 --- a/libssh/sftp.c +++ b/libssh/sftp.c @@ -36,7 +36,8 @@ #include "libssh/priv.h" #include "libssh/ssh2.h" #include "libssh/sftp.h" -#ifndef NO_SFTP + +#ifdef WITH_SFTP #define sftp_enter_function() _enter_function(sftp->channel->session) #define sftp_leave_function() _leave_function(sftp->channel->session) @@ -2387,5 +2388,5 @@ SFTP_ATTRIBUTES *sftp_fstat(SFTP_FILE *file) { return NULL; } -#endif /* NO_SFTP */ +#endif /* WITH_SFTP */ -- cgit