]> git.siccegge.de Git - frida/frida.git/commitdiff
Make commandline parser optional to build against cip qt 5.1
authorChristoph Egger <christoph@anonymous.siccegge.de>
Wed, 19 Nov 2014 15:46:36 +0000 (16:46 +0100)
committerChristoph Egger <christoph@anonymous.siccegge.de>
Wed, 19 Nov 2014 15:46:36 +0000 (16:46 +0100)
src/main.cxx

index 80e06cea3fe324195a01415ed4af18537d3741aa..ebb85e87924d457a80c388a32a62f35a56b26fb6 100644 (file)
@@ -4,7 +4,13 @@
 #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"
@@ -23,15 +29,19 @@ int main(int argc, char** argv)
     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();
@@ -41,12 +51,12 @@ int main(int argc, char** argv)
 
     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();