option(DISABLE_WERROR "Build without -Werror" FALSE)
option(ENABLE_SIGNALS "Build with UNIX signals" TRUE)
-option(ENABLE_SIGROKDECODE "Build with libsigrokdecode" FALSE)
option(ENABLE_TESTS "Enable unit tests" FALSE)
option(STATIC_PKGDEPS_LIBS "Statically link to (pkgconfig) libraries" FALSE)
list(APPEND PKGDEPS
libsigrok>=0.2.0
+ libsigrokdecode>=0.2.0
)
-if(ENABLE_SIGROKDECODE)
- list(APPEND PKGDEPS libsigrokdecode>=0.2.0)
-endif()
-
find_package(PkgConfig)
pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS})
add_definitions(${QT_DEFINITIONS})
add_definitions(-Wall -Wextra)
-if(ENABLE_SIGROKDECODE)
- add_definitions(-DENABLE_SIGROKDECODE)
-endif()
-
if(NOT DISABLE_WERROR)
add_definitions(-Werror)
endif()
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifdef ENABLE_SIGROKDECODE
#include <libsigrokdecode/libsigrokdecode.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
-#endif
#include <stdint.h>
#include <libsigrok/libsigrok.h>
{
const int loglevel = atoi(optarg);
sr_log_loglevel_set(loglevel);
-
-#ifdef ENABLE_SIGROKDECODE
srd_log_loglevel_set(loglevel);
-#endif
break;
}
do {
-#ifdef ENABLE_SIGROKDECODE
// Initialise libsigrokdecode
if (srd_init(NULL) != SRD_OK) {
qDebug() << "ERROR: libsigrokdecode init failed.";
// Load the protocol decoders
srd_decoder_load_all();
-#endif
try {
// Create the device manager, initialise the drivers
qDebug() << e.what();
}
-#ifdef ENABLE_SIGROKDECODE
// Destroy libsigrokdecode
srd_exit();
-#endif
} while (0);
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifdef ENABLE_SIGROKDECODE
#include <libsigrokdecode/libsigrokdecode.h>
-#endif
#include <QTextDocument>
struct sr_input_format **inputs;
struct sr_output_format **outputs;
-#ifdef ENABLE_SIGROKDECODE
struct srd_decoder *dec;
-#endif
QString s;
.arg(QString(outputs[i]->description)));
}
-#ifdef ENABLE_SIGROKDECODE
s.append("<tr><td colspan=\"2\"><b>" +
tr("Supported protocol decoders:") +
"</b></td></tr>");
.arg(QString(dec->id))
.arg(QString(dec->longname)));
}
-#endif
s.append("</table>");
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifdef ENABLE_SIGROKDECODE
#include <libsigrokdecode/libsigrokdecode.h>
-#endif
#include <boost/bind.hpp>
#include <boost/foreach.hpp>