diff --git a/backends/libpurple/CMakeLists.txt b/backends/libpurple/CMakeLists.txt index 7d8c9f0dfcf8083e657b09f1299bce71ee30e7f1..ad53b62b4c44b970567a0a059d6409210fd2a3fa 100644 --- a/backends/libpurple/CMakeLists.txt +++ b/backends/libpurple/CMakeLists.txt @@ -4,7 +4,11 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(spectrum2_libpurple_backend ${SRC}) if(CMAKE_COMPILER_IS_GNUCXX) -target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin pthread) + if (NOT WIN32) + target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin pthread) + else() + target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin) + endif() else() include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin libprotobuf) diff --git a/backends/template/CMakeLists.txt b/backends/template/CMakeLists.txt index b40d31ef339d60378b0d97ea0ef11d3750b334f5..d0878729bb16d64384f49a4d6a99f062c7cabe07 100644 --- a/backends/template/CMakeLists.txt +++ b/backends/template/CMakeLists.txt @@ -5,8 +5,12 @@ FILE(GLOB SRC *.c *.cpp) ADD_EXECUTABLE(spectrum2_template_backend ${SRC}) if (CMAKE_COMPILER_IS_GNUCXX) +if (NOT WIN32) target_link_libraries(spectrum2_template_backend transport pthread ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) else() +target_link_libraries(spectrum2_template_backend transport ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) +endif() +else() include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") target_link_libraries(spectrum2_template_backend transport libprotobuf ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) endif() diff --git a/src/logging.cpp b/src/logging.cpp index bd78eec82db11e862f6fe54d7d71ba40cb5a711a..f86816a8ad208a6cb739ef876ed72ed50cfcdc07 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -55,7 +55,7 @@ static LoggerPtr root; static void initLogging(Config *config, std::string key) { if (CONFIG_STRING(config, key).empty()) { root = log4cxx::Logger::getRootLogger(); -#ifdef WIN32 +#ifdef _MSC_VER root->addAppender(new ConsoleAppender(new PatternLayout(L"%d %-5p %c: %m%n"))); #else root->addAppender(new ConsoleAppender(new PatternLayout("%d %-5p %c: %m%n"))); @@ -83,7 +83,7 @@ static void initLogging(Config *config, std::string key) { LogString pid, jid; log4cxx::helpers::Transcoder::decode(boost::lexical_cast(getpid()), pid); log4cxx::helpers::Transcoder::decode(CONFIG_STRING(config, "service.jid"), jid); -#ifdef WIN32 +#ifdef _MSC_VER p.setProperty(L"pid", pid); p.setProperty(L"jid", jid); #else