enable twitter and libcommuni builds in windows

This commit is contained in:
Vitaly Takmazov 2012-11-28 10:02:27 +04:00
parent ae953ed2e0
commit f9696d0db6
3 changed files with 11 additions and 4 deletions

View file

@ -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)

View file

@ -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 <boost/algorithm/string.hpp>
#include <boost/signal.hpp>
#include <boost/thread.hpp>

View file

@ -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);