From f9696d0db6f1821792a22eeaf829f3ab331ce209 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 28 Nov 2012 10:02:27 +0400 Subject: [PATCH] enable twitter and libcommuni builds in windows --- backends/libcommuni/CMakeLists.txt | 7 +++++-- backends/twitter/TwitterPlugin.h | 3 ++- backends/twitter/main.cpp | 5 ++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/backends/libcommuni/CMakeLists.txt b/backends/libcommuni/CMakeLists.txt index 38e7507b..d874e4a1 100644 --- a/backends/libcommuni/CMakeLists.txt +++ b/backends/libcommuni/CMakeLists.txt @@ -1,10 +1,13 @@ cmake_minimum_required(VERSION 2.6) FILE(GLOB SRC *.cpp) FILE(GLOB HEADERS *.h) -QT4_WRAP_CPP(SRC ${HEADERS}) +QT4_WRAP_CPP(SRC ${HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED) ADD_EXECUTABLE(spectrum2_libcommuni_backend ${SRC}) +if (NOT WIN32) target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} ${QT_LIBRARIES} transport pthread) - +else () +target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} ${QT_LIBRARIES} transport) +endif() INSTALL(TARGETS spectrum2_libcommuni_backend RUNTIME DESTINATION bin) diff --git a/backends/twitter/TwitterPlugin.h b/backends/twitter/TwitterPlugin.h index b49ea866..e7cc5be0 100644 --- a/backends/twitter/TwitterPlugin.h +++ b/backends/twitter/TwitterPlugin.h @@ -11,11 +11,12 @@ #include "transport/threadpool.h" #include "Swiften/Swiften.h" +#ifndef _WIN32 #include "unistd.h" #include "signal.h" #include "sys/wait.h" #include "sys/signal.h" - +#endif #include #include #include diff --git a/backends/twitter/main.cpp b/backends/twitter/main.cpp index 5cbf2def..ce32639e 100644 --- a/backends/twitter/main.cpp +++ b/backends/twitter/main.cpp @@ -1,6 +1,7 @@ #include "TwitterPlugin.h" DEFINE_LOGGER(logger, "Twitter Backend"); +#ifndef _WIN32 static void spectrum_sigchld_handler(int sig) { int status; @@ -16,16 +17,18 @@ static void spectrum_sigchld_handler(int sig) perror(errmsg); } } +#endif int main (int argc, char* argv[]) { std::string host; int port; - +#ifndef _WIN32 if (signal(SIGCHLD, spectrum_sigchld_handler) == SIG_ERR) { std::cout << "SIGCHLD handler can't be set\n"; return -1; } +#endif std::string error; Config *cfg = Config::createFromArgs(argc, argv, error, host, port);