mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-06 22:49:35 +00:00
added DISABLE_PE define
This commit is contained in:
parent
fb7058696a
commit
c06fc3b5b5
@ -32,6 +32,10 @@ android: DEFINES += WITHOUT_TESTS
|
||||
unix:SUBDIRS += tests/quicknanobrowser
|
||||
unix:SUBDIRS += tests/webui
|
||||
|
||||
contains(DEFINES, DISABLE_PE) {
|
||||
SUBDIRS -= Pe
|
||||
DEFINES += WITHOUT_TESTS
|
||||
}
|
||||
|
||||
contains(DEFINES, WITHOUT_TESTS) {
|
||||
SUBDIRS -= UnitTests \
|
||||
|
@ -31,8 +31,9 @@ include('$$PWD/../QuasarAppLib/QuasarLib.pri')
|
||||
include('$$PWD/../Deploy/Deploy.pri')
|
||||
include('$$PWD/../zip/zip.pri')
|
||||
|
||||
include('$$PWD/../pe/pe-parser-library/pe-parser-library.pri')
|
||||
|
||||
!contains(DEFINES, DISABLE_PE) {
|
||||
include('$$PWD/../pe/pe-parser-library/pe-parser-library.pri')
|
||||
}
|
||||
|
||||
TARGET = cqtdeployer
|
||||
|
||||
|
@ -41,7 +41,9 @@ CONFIG(release, debug|release): {
|
||||
}
|
||||
|
||||
include('$$PWD/../QuasarAppLib/QuasarLib.pri')
|
||||
include('$$PWD/../pe/pe-parser-library/pe-parser-library.pri')
|
||||
!contains(DEFINES, DISABLE_PE) {
|
||||
include('$$PWD/../pe/pe-parser-library/pe-parser-library.pri')
|
||||
}
|
||||
include('$$PWD/../zip/zip.pri')
|
||||
|
||||
|
||||
|
@ -11,15 +11,18 @@
|
||||
#include <QFileInfo>
|
||||
#include <QSet>
|
||||
#include <QVector>
|
||||
#include <pe-parse/parse.h>
|
||||
#include <quasarapp.h>
|
||||
|
||||
#include <set>
|
||||
|
||||
#ifndef DISABLE_PE
|
||||
#include <pe-parse/parse.h>
|
||||
|
||||
namespace peparse {
|
||||
|
||||
class section;
|
||||
|
||||
|
||||
struct importent {
|
||||
VA addr;
|
||||
std::string symbolName;
|
||||
@ -63,6 +66,7 @@ bool PE::getDep(peparse::parsed_pe_internal * internal, LibInfo &res) const {
|
||||
|
||||
return res.getDependncies().size() || !imports.size();
|
||||
}
|
||||
#endif
|
||||
|
||||
QHash<WinAPI, QSet<QString> > PE::getWinAPI() const {
|
||||
return _winAPI;
|
||||
@ -110,6 +114,7 @@ PE::PE(): IGetLibInfo () {
|
||||
}
|
||||
|
||||
bool PE::getLibInfo(const QString &lib, LibInfo &info) const {
|
||||
#ifndef DISABLE_PE
|
||||
auto parsedPeLib = peparse::ParsePEFromFile(lib.toLatin1());
|
||||
|
||||
if (!parsedPeLib)
|
||||
@ -155,6 +160,11 @@ bool PE::getLibInfo(const QString &lib, LibInfo &info) const {
|
||||
|
||||
|
||||
return info.isValid();
|
||||
#else
|
||||
Q_UNUSED(lib)
|
||||
Q_UNUSED(info)
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
PE::~PE(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user