From: Joel Holdsworth Date: Thu, 18 Apr 2013 20:17:47 +0000 (+0100) Subject: Made UNIX signals an optional feature X-Git-Tag: pulseview-0.1.0~39 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=140181a46034cf65739ba4bf0bf1260ab94ac736;p=pulseview.git Made UNIX signals an optional feature --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8566adf0..2d9ec8f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ 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) @@ -40,6 +41,9 @@ if(WIN32) # For boost-thread we need two additional settings on win32: set(Boost_USE_STATIC_LIBS on) add_definitions(-DBOOST_THREAD_USE_LIB) + + # Windsws does not support UNIX signals + set(ENABLE_SIGNALS FALSE) endif() #=============================================================================== @@ -96,7 +100,6 @@ configure_file ( set(pulseview_SOURCES main.cpp - signalhandler.cpp pv/mainwindow.cpp pv/sigsession.cpp pv/data/analog.cpp @@ -128,7 +131,6 @@ set(pulseview_SOURCES ) set(pulseview_HEADERS - signalhandler.h pv/mainwindow.h pv/sigsession.h pv/dialogs/about.h @@ -151,6 +153,11 @@ set(pulseview_RESOURCES pulseview.qrc ) +if(ENABLE_SIGNALS) + list(APPEND pulseview_SOURCES signalhandler.cpp) + list(APPEND pulseview_HEADERS signalhandler.h) +endif() + qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS}) qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS}) qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES}) diff --git a/main.cpp b/main.cpp index b72fc70c..715dc526 100644 --- a/main.cpp +++ b/main.cpp @@ -30,7 +30,10 @@ #include #include +#ifdef ENABLE_SIGNALS #include "signalhandler.h" +#endif + #include "pv/mainwindow.h" #include "config.h" @@ -141,6 +144,7 @@ int main(int argc, char *argv[]) pv::MainWindow w(open_file); w.show(); +#ifdef ENABLE_SIGNALS if(SignalHandler::prepare_signals()) { SignalHandler *const handler = new SignalHandler(&w); @@ -154,6 +158,7 @@ int main(int argc, char *argv[]) qWarning() << "Could not prepare signal handler."; } +#endif // Run the application ret = a.exec();