#include <climits>
#include <QApplication>
+#if QT_VERSION > QT_VERSION_CHECK(5, 2, 0)
+#define ARGPARSE
+#endif
+
+#ifdef ARGPARSE
#include <QCommandLineParser>
+#endif
#include <QTextEdit>
#include "log4cxx/logger.h"
log4cxx::BasicConfigurator::configure();
log4cxx::LoggerPtr _logger(log4cxx::Logger::getLogger("main"));
+#ifdef ARGPARSE
QCommandLineParser parser;
+#endif
QApplication::setApplicationName("frida");
+#ifdef ARGPARSE
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("filename", QCoreApplication::translate("main", "File to disassemble."));
parser.process(app);
+#endif
LOG4CXX_DEBUG(_logger, "Initializing LLVM");
llvm::InitializeAllTargetInfos();
LOG4CXX_DEBUG(_logger, "Initializing Qt");
- std::string filename;
- if (parser.positionalArguments().isEmpty()) {
- filename = "";
- } else {
+ std::string filename = "";
+#ifdef ARGPARSE
+ if (! parser.positionalArguments().isEmpty()) {
filename = parser.positionalArguments().at(0).toStdString();
}
+#endif
Mainwindow m(filename);
m.show();