fix compilation 5

This commit is contained in:
Vitaly Takmazov 2012-04-18 10:07:35 +04:00
parent 27004b5fc7
commit c0001513e4
3 changed files with 11 additions and 3 deletions

View file

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

View file

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

View file

@ -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<std::string>(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