projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix the C++11 thread linking issues for unit tests as well.
[pulseview.git]
/
main.cpp
diff --git
a/main.cpp
b/main.cpp
index 07cfa2facfb9eefce062c243ad4f6d7ead0a417b..5c3e5b25818ffc70d1ac28a347e9b33cb91bda47 100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-18,25
+18,37
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef ENABLE_DECODE
#include <libsigrokdecode/libsigrokdecode.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
#include <libsigrokdecode/libsigrokdecode.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
+#endif
#include <stdint.h>
#include <libsigrok/libsigrok.h>
#include <getopt.h>
#include <stdint.h>
#include <libsigrok/libsigrok.h>
#include <getopt.h>
-#include <QtGui/QApplication>
#include <QDebug>
#ifdef ENABLE_SIGNALS
#include "signalhandler.h"
#endif
#include <QDebug>
#ifdef ENABLE_SIGNALS
#include "signalhandler.h"
#endif
+#include "pv/application.h"
#include "pv/devicemanager.h"
#include "pv/mainwindow.h"
#include "pv/devicemanager.h"
#include "pv/mainwindow.h"
+#ifdef ANDROID
+#include <libsigrokandroidutils/libsigrokandroidutils.h>
+#include "android/loghandler.h"
+#endif
#include "config.h"
#include "config.h"
+#ifdef _WIN32
+// The static qsvg lib is required for SVG graphics/icons (on Windows).
+#include <QtPlugin>
+Q_IMPORT_PLUGIN(qsvg)
+#endif
+
void usage()
{
fprintf(stdout,
void usage()
{
fprintf(stdout,
@@
-56,12
+68,12
@@
int main(int argc, char *argv[])
struct sr_context *sr_ctx = NULL;
const char *open_file = NULL;
struct sr_context *sr_ctx = NULL;
const char *open_file = NULL;
-
Q
Application a(argc, argv);
+ Application a(argc, argv);
- // Set some application metadata
-
QApplication::setApplicationVersion(PV_VERSION_STRING
);
-
QApplication::setApplicationName("PulseView"
);
- QApplication::setOrganizationDomain("http://www.sigrok.org");
+#ifdef ANDROID
+
srau_init_environment(
);
+
pv::AndroidLogHandler::install_callbacks(
);
+#endif
// Parse arguments
while (1) {
// Parse arguments
while (1) {
@@
-82,7
+94,10
@@
int main(int argc, char *argv[])
{
const int loglevel = atoi(optarg);
sr_log_loglevel_set(loglevel);
{
const int loglevel = atoi(optarg);
sr_log_loglevel_set(loglevel);
+
+#ifdef ENABLE_DECODE
srd_log_loglevel_set(loglevel);
srd_log_loglevel_set(loglevel);
+#endif
break;
}
break;
}
@@
-113,6
+128,7
@@
int main(int argc, char *argv[])
do {
do {
+#ifdef ENABLE_DECODE
// Initialise libsigrokdecode
if (srd_init(NULL) != SRD_OK) {
qDebug() << "ERROR: libsigrokdecode init failed.";
// Initialise libsigrokdecode
if (srd_init(NULL) != SRD_OK) {
qDebug() << "ERROR: libsigrokdecode init failed.";
@@
-121,6
+137,7
@@
int main(int argc, char *argv[])
// Load the protocol decoders
srd_decoder_load_all();
// Load the protocol decoders
srd_decoder_load_all();
+#endif
try {
// Create the device manager, initialise the drivers
try {
// Create the device manager, initialise the drivers
@@
-153,8
+170,10
@@
int main(int argc, char *argv[])
qDebug() << e.what();
}
qDebug() << e.what();
}
+#ifdef ENABLE_DECODE
// Destroy libsigrokdecode
srd_exit();
// Destroy libsigrokdecode
srd_exit();
+#endif
} while (0);
} while (0);