From f68020a6ba081faaea5bce13328354790b416dcf 2012-05-22 10:28:26 From: Vitaly Takmazov Date: 2012-05-22 10:28:26 Subject: [PATCH] Fixed compilation of swiften plugin for win32 --- diff --git a/backends/CMakeLists.txt b/backends/CMakeLists.txt index 761249d7cf982642cd824b02408d4c4fe4aa1ca1..63de7f0deb73ce89c18164328fc685cebb670fcd 100644 --- a/backends/CMakeLists.txt +++ b/backends/CMakeLists.txt @@ -7,8 +7,6 @@ if (PROTOBUF_FOUND) ADD_SUBDIRECTORY(libcommuni) endif() - ADD_SUBDIRECTORY(smstools3) - ADD_SUBDIRECTORY(swiften) ADD_SUBDIRECTORY(template) diff --git a/backends/swiften/CMakeLists.txt b/backends/swiften/CMakeLists.txt index d8861e057f001a5586a13424ba78569cc9d8aa95..b605a9478b281ff16fcde7abef7ba6557ada1e05 100644 --- a/backends/swiften/CMakeLists.txt +++ b/backends/swiften/CMakeLists.txt @@ -4,7 +4,11 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(spectrum2_swiften_backend ${SRC}) +IF (NOT WIN32) target_link_libraries(spectrum2_swiften_backend transport pthread ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) +else() +target_link_libraries(spectrum2_swiften_backend transport ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) +endif() INSTALL(TARGETS spectrum2_swiften_backend RUNTIME DESTINATION bin) diff --git a/backends/swiften/main.cpp b/backends/swiften/main.cpp index 642930fca39ba11b78acf76241d61a4d86f75967..a9a240705bcc97223792536082aec39eeb8244be 100644 --- a/backends/swiften/main.cpp +++ b/backends/swiften/main.cpp @@ -6,11 +6,13 @@ // Swiften #include "Swiften/Swiften.h" +#ifndef WIN32 // for signal handler #include "unistd.h" #include "signal.h" #include "sys/wait.h" #include "sys/signal.h" +#endif // malloc_trim #include "malloc.h" @@ -231,6 +233,7 @@ class SwiftenPlugin : public NetworkPlugin { std::map > m_users; }; +#ifndef WIN32 static void spectrum_sigchld_handler(int sig) { int status; @@ -246,16 +249,19 @@ 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 boost::program_options::options_description desc("Usage: spectrum [OPTIONS] \nAllowed options"); desc.add_options()