Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't include sigwatch on Windows builds
  • Loading branch information
nyalldawson committed Apr 15, 2020
1 parent f9a58d2 commit 1140a08
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/process/CMakeLists.txt
Expand Up @@ -4,9 +4,14 @@
SET(QGIS_PROCESS_SRCS
main.cpp
qgsprocess.cpp
${CMAKE_SOURCE_DIR}/external/qt-unix-signals/sigwatch.cpp
)

IF (UNIX AND NOT APPLE AND NOT ANDROID)
SET(QGIS_PROCESS_SRCS ${QGIS_PROCESS_SRCS}
${CMAKE_SOURCE_DIR}/external/qt-unix-signals/sigwatch.cpp
)
ENDIF (UNIX AND NOT APPLE AND NOT ANDROID)

########################################################
# Build

Expand All @@ -16,10 +21,16 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
)
INCLUDE_DIRECTORIES(SYSTEM
${CMAKE_SOURCE_DIR}/external/qt-unix-signals
${QT_INCLUDE_DIR}
${QGIS_INCLUDE_DIR}
)

IF (UNIX AND NOT APPLE AND NOT ANDROID)
INCLUDE_DIRECTORIES(SYSTEM
${CMAKE_SOURCE_DIR}/external/qt-unix-signals
)
ENDIF (UNIX AND NOT APPLE AND NOT ANDROID)

INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/expression
Expand Down
5 changes: 5 additions & 0 deletions src/process/qgsprocess.cpp
Expand Up @@ -26,7 +26,10 @@
#include "qgsapplication.h"
#include "qgsprocessingparametertype.h"

#if !defined(Q_OS_WIN)
#include "sigwatch.h"
#endif

#include <iostream>

ConsoleFeedback::ConsoleFeedback()
Expand Down Expand Up @@ -393,6 +396,7 @@ int QgsProcessingExec::execute( const QString &id, const QVariantMap &params )
QgsProcessingContext context;
ConsoleFeedback feedback;

#if !defined(Q_OS_WIN)
UnixSignalWatcher sigwatch;
sigwatch.watchForSignal( SIGINT );

Expand All @@ -408,6 +412,7 @@ int QgsProcessingExec::execute( const QString &id, const QVariantMap &params )
break;
}
} );
#endif

bool ok = false;
std::cout << "\n";
Expand Down

0 comments on commit 1140a08

Please sign in to comment.