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.
This commit is contained in:
Olivier Goffart 2018-04-18 14:18:10 +02:00 committed by Kevin Ottens
parent b1dc14977f
commit 7969067f80
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2

View file

@ -23,7 +23,9 @@
#include <iostream> #include <iostream>
#ifdef ZLIB_FOUND
#include <zlib.h> #include <zlib.h>
#endif
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <io.h> // for stdout #include <io.h> // for stdout
@ -261,6 +263,7 @@ void Logger::disableTemporaryFolderLogDir()
static bool compressLog(const QString &originalName, const QString &targetName) static bool compressLog(const QString &originalName, const QString &targetName)
{ {
#ifdef ZLIB_FOUND
QFile original(originalName); QFile original(originalName);
if (!original.open(QIODevice::ReadOnly)) if (!original.open(QIODevice::ReadOnly))
return false; return false;
@ -279,6 +282,9 @@ static bool compressLog(const QString &originalName, const QString &targetName)
} }
gzclose(compressed); gzclose(compressed);
return true; return true;
#else
return false;
#endif
} }
void Logger::enterNextLogFile() void Logger::enterNextLogFile()