1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

fix windows compile error

This commit is contained in:
Davide Gerhard 2019-05-02 16:04:43 +02:00
parent 8bb258cdee
commit bec2eb209b
No known key found for this signature in database
GPG Key ID: 7CBEFA144857DC97
3 changed files with 13 additions and 1 deletions

View File

@ -79,7 +79,11 @@ endif()
# declare build structures
# !! change sdrbase/plugin/pluginmanager.cpp too !!
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(BUILD_PLUGINS_DIR ${CMAKE_BINARY_DIR}/lib/plugins)

View File

@ -34,6 +34,7 @@ void handler(int sig) {
QCoreApplication::quit();
}
#ifndef _WIN32
void catchUnixSignals(const std::vector<int>& quitSignals) {
sigset_t blocking_mask;
sigemptyset(&blocking_mask);
@ -51,6 +52,7 @@ void catchUnixSignals(const std::vector<int>& quitSignals) {
sigaction(*it, &sa, 0);
}
}
#endif
static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *logger)
{
@ -60,9 +62,11 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
QCoreApplication::setApplicationName("SDRangelBench");
QCoreApplication::setApplicationVersion(SDRANGEL_VERSION);
#ifndef _WIN32
int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP};
std::vector<int> vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int));
catchUnixSignals(vsig);
#endif
ParserBench parser;
parser.parse(a);

View File

@ -33,6 +33,7 @@ void handler(int sig) {
QCoreApplication::quit();
}
#ifndef _WIN32
void catchUnixSignals(const std::vector<int>& quitSignals) {
sigset_t blocking_mask;
sigemptyset(&blocking_mask);
@ -50,6 +51,7 @@ void catchUnixSignals(const std::vector<int>& quitSignals) {
sigaction(*it, &sa, 0);
}
}
#endif
static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *logger)
{
@ -59,9 +61,11 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
QCoreApplication::setApplicationName("SDRangelSrv");
QCoreApplication::setApplicationVersion(SDRANGEL_VERSION);
#ifndef _WIN32
int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP};
std::vector<int> vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int));
catchUnixSignals(vsig);
#endif
MainParser parser;
parser.parse(a);