From d13e1133f0066bb01cb6f6e900579a8a059d0cdf Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 1 Jan 2015 12:54:21 +0100 Subject: [PATCH] Fixed build issues when disabling filesystem features. --- CMakeLists.txt | 5 +++++ src/vmime/fileContentHandler.cpp | 9 +++++++++ src/vmime/fileContentHandler.hpp | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd2eee89..6e0f8010 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1073,6 +1073,11 @@ IF(VMIME_HAVE_MESSAGING_FEATURES AND VMIME_HAVE_MESSAGING_PROTO_MAILDIR AND NOT MESSAGE(FATAL_ERROR "Maildir protocol requires file-system support (VMIME_HAVE_FILESYSTEM_FEATURES must be set to ON).") ENDIF() +# Sendmail protocol is available only if file-system features are enabled +IF(VMIME_HAVE_MESSAGING_FEATURES AND VMIME_HAVE_MESSAGING_PROTO_SENDMAIL AND NOT VMIME_HAVE_FILESYSTEM_FEATURES) + MESSAGE(FATAL_ERROR "Sendmail protocol requires file-system support (VMIME_HAVE_FILESYSTEM_FEATURES must be set to ON).") +ENDIF() + # Path to 'sendmail' must be specified if Sendmail protocol is enabled IF(VMIME_HAVE_MESSAGING_PROTO_SENDMAIL) IF(NOT VMIME_SENDMAIL_PATH OR VMIME_SENDMAIL_PATH STREQUAL "") diff --git a/src/vmime/fileContentHandler.cpp b/src/vmime/fileContentHandler.cpp index 53ec9f69..df788d7d 100644 --- a/src/vmime/fileContentHandler.cpp +++ b/src/vmime/fileContentHandler.cpp @@ -21,6 +21,12 @@ // the GNU General Public License cover the whole combination. // +#include "vmime/config.hpp" + + +#if VMIME_HAVE_FILESYSTEM_FEATURES + + #include "vmime/fileContentHandler.hpp" @@ -79,3 +85,6 @@ void fileContentHandler::setData } // vmime + + +#endif // VMIME_HAVE_FILESYSTEM_FEATURES diff --git a/src/vmime/fileContentHandler.hpp b/src/vmime/fileContentHandler.hpp index 68b4d396..5b01fb8b 100644 --- a/src/vmime/fileContentHandler.hpp +++ b/src/vmime/fileContentHandler.hpp @@ -25,6 +25,12 @@ #define VMIME_FILECONTENTHANDLER_HPP_INCLUDED +#include "vmime/config.hpp" + + +#if VMIME_HAVE_FILESYSTEM_FEATURES + + #include "vmime/streamContentHandler.hpp" #include "vmime/utility/file.hpp" @@ -90,4 +96,7 @@ private: } // vmime +#endif // VMIME_HAVE_FILESYSTEM_FEATURES + + #endif // VMIME_FILECONTENTHANDLER_HPP_INCLUDED