X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=main.cpp;h=2c6a59efd22c8d14d181223c45c1abc92279e9d4;hp=07cfa2facfb9eefce062c243ad4f6d7ead0a417b;hb=6d8b05622f1e422c7193656c9eac3ebae5b6b934;hpb=0de8fb27ab376153db50bed98e643767e4eac1a4 diff --git a/main.cpp b/main.cpp index 07cfa2fa..2c6a59ef 100644 --- a/main.cpp +++ b/main.cpp @@ -18,7 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef ENABLE_DECODE #include /* First, so we avoid a _POSIX_C_SOURCE warning. */ +#endif #include #include @@ -37,6 +39,12 @@ #include "config.h" +#ifdef _WIN32 +// The static qsvg lib is required for SVG graphics/icons (on Windows). +#include +Q_IMPORT_PLUGIN(qsvg) +#endif + void usage() { fprintf(stdout, @@ -82,7 +90,10 @@ int main(int argc, char *argv[]) { const int loglevel = atoi(optarg); sr_log_loglevel_set(loglevel); + +#ifdef ENABLE_DECODE srd_log_loglevel_set(loglevel); +#endif break; } @@ -113,6 +124,7 @@ int main(int argc, char *argv[]) do { +#ifdef ENABLE_DECODE // Initialise libsigrokdecode if (srd_init(NULL) != SRD_OK) { qDebug() << "ERROR: libsigrokdecode init failed."; @@ -121,6 +133,7 @@ int main(int argc, char *argv[]) // Load the protocol decoders srd_decoder_load_all(); +#endif try { // Create the device manager, initialise the drivers @@ -153,8 +166,10 @@ int main(int argc, char *argv[]) qDebug() << e.what(); } +#ifdef ENABLE_DECODE // Destroy libsigrokdecode srd_exit(); +#endif } while (0);