From: Joel Holdsworth Date: Sat, 1 Jun 2013 15:30:48 +0000 (+0100) Subject: Make sigrokdecode a non-optional dependancy X-Git-Tag: pulseview-0.2.0~320 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0de8fb27ab376153db50bed98e643767e4eac1a4;p=pulseview.git Make sigrokdecode a non-optional dependancy --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a5a91045..724adcd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,6 @@ project(pulseview) 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) @@ -57,12 +56,9 @@ endif() 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}) @@ -190,10 +186,6 @@ include(${QT_USE_FILE}) add_definitions(${QT_DEFINITIONS}) add_definitions(-Wall -Wextra) -if(ENABLE_SIGROKDECODE) - add_definitions(-DENABLE_SIGROKDECODE) -endif() - if(NOT DISABLE_WERROR) add_definitions(-Werror) endif() diff --git a/main.cpp b/main.cpp index 5257b791..07cfa2fa 100644 --- a/main.cpp +++ b/main.cpp @@ -18,9 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef ENABLE_SIGROKDECODE #include /* First, so we avoid a _POSIX_C_SOURCE warning. */ -#endif #include #include @@ -84,10 +82,7 @@ int main(int argc, char *argv[]) { const int loglevel = atoi(optarg); sr_log_loglevel_set(loglevel); - -#ifdef ENABLE_SIGROKDECODE srd_log_loglevel_set(loglevel); -#endif break; } @@ -118,7 +113,6 @@ int main(int argc, char *argv[]) do { -#ifdef ENABLE_SIGROKDECODE // Initialise libsigrokdecode if (srd_init(NULL) != SRD_OK) { qDebug() << "ERROR: libsigrokdecode init failed."; @@ -127,7 +121,6 @@ int main(int argc, char *argv[]) // Load the protocol decoders srd_decoder_load_all(); -#endif try { // Create the device manager, initialise the drivers @@ -160,10 +153,8 @@ int main(int argc, char *argv[]) qDebug() << e.what(); } -#ifdef ENABLE_SIGROKDECODE // Destroy libsigrokdecode srd_exit(); -#endif } while (0); diff --git a/pv/dialogs/about.cpp b/pv/dialogs/about.cpp index 98d44690..806dc4c5 100644 --- a/pv/dialogs/about.cpp +++ b/pv/dialogs/about.cpp @@ -18,9 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef ENABLE_SIGROKDECODE #include -#endif #include @@ -44,9 +42,7 @@ About::About(QWidget *parent) : struct sr_input_format **inputs; struct sr_output_format **outputs; -#ifdef ENABLE_SIGROKDECODE struct srd_decoder *dec; -#endif QString s; @@ -93,7 +89,6 @@ About::About(QWidget *parent) : .arg(QString(outputs[i]->description))); } -#ifdef ENABLE_SIGROKDECODE s.append("" + tr("Supported protocol decoders:") + ""); @@ -103,7 +98,6 @@ About::About(QWidget *parent) : .arg(QString(dec->id)) .arg(QString(dec->longname))); } -#endif s.append(""); diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 2a4ebc25..5fe4ccb6 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -18,9 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef ENABLE_SIGROKDECODE #include -#endif #include #include