diff --git a/plugin/src/CMakeLists.txt b/plugin/src/CMakeLists.txt index f432ff6c634cee2449d75626c1d762e8e380cbf5..6e67ab09b10db3ab3650845c668a35d7e063714e 100644 --- a/plugin/src/CMakeLists.txt +++ b/plugin/src/CMakeLists.txt @@ -5,9 +5,16 @@ FILE(GLOB HEADERS ../include/transport/*.h) ADD_LIBRARY(transport-plugin SHARED ${HEADERS} ${SRC} ${PROTOBUF_SRC} ${PROTOBUF_HDRS} ../../src/memoryusage.cpp ${CMAKE_CURRENT_BINARY_DIR}/../../include/transport/protocol.pb.cc) ADD_DEPENDENCIES(transport-plugin pb) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/../../include/transport/protocol.pb.cc PROPERTIES GENERATED 1) -ADD_DEFINITIONS(-fPIC) +if (CMAKE_COMPILER_IS_GNUCXX) + ADD_DEFINITIONS(-fPIC) +endif() + +if (NOT WIN32) TARGET_LINK_LIBRARIES(transport-plugin ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES}) +else() +TARGET_LINK_LIBRARIES(transport-plugin ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES} ws2_32.lib) +endif() SET_TARGET_PROPERTIES(transport-plugin PROPERTIES VERSION ${TRANSPORT_VERSION} SOVERSION ${TRANSPORT_VERSION} diff --git a/plugin/src/networkplugin.cpp b/plugin/src/networkplugin.cpp index 9b08d72d3d4976e84005d27b35c65d8b86cfcda2..82aa3bb45f4c640d1d5f7ecd609d6df7e77c5ef7 100644 --- a/plugin/src/networkplugin.cpp +++ b/plugin/src/networkplugin.cpp @@ -23,7 +23,11 @@ #include "log4cxx/basicconfigurator.h" #include "transport/memoryusage.h" +#ifndef WIN32 #include +#else +#include +#endif using namespace log4cxx;