From 7969067f80a84aa4e2badc7315d95cd01ea6b1af Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 18 Apr 2018 14:18:10 +0200 Subject: [PATCH] Logger: Guard zlib usage by ZLIB_FOUND Similar to the use for the checksum. I know that zlib is required in principle, but i don't have it in one of my test building environment, and it is easier to just disable it. --- src/libsync/logger.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp index d5d204831..a9df83a63 100644 --- a/src/libsync/logger.cpp +++ b/src/libsync/logger.cpp @@ -23,7 +23,9 @@ #include +#ifdef ZLIB_FOUND #include +#endif #ifdef Q_OS_WIN #include // for stdout @@ -261,6 +263,7 @@ void Logger::disableTemporaryFolderLogDir() static bool compressLog(const QString &originalName, const QString &targetName) { +#ifdef ZLIB_FOUND QFile original(originalName); if (!original.open(QIODevice::ReadOnly)) return false; @@ -279,6 +282,9 @@ static bool compressLog(const QString &originalName, const QString &targetName) } gzclose(compressed); return true; +#else + return false; +#endif } void Logger::enterNextLogFile() -- 2.30.2