From c0001513e46524509daeaea274269e20a3fd19b3 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 18 Apr 2012 10:07:35 +0400 Subject: [PATCH] fix compilation 5 --- backends/libpurple/CMakeLists.txt | 6 +++++- backends/template/CMakeLists.txt | 4 ++++ src/logging.cpp | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/backends/libpurple/CMakeLists.txt b/backends/libpurple/CMakeLists.txt index 7d8c9f0d..ad53b62b 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 b40d31ef..d0878729 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 bd78eec8..f86816a8 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