diff --git a/plugins/server/CMakeLists.txt b/plugins/server/CMakeLists.txt index e8f26c60a..5af8e58fd 100644 --- a/plugins/server/CMakeLists.txt +++ b/plugins/server/CMakeLists.txt @@ -23,10 +23,20 @@ IF(UNIX) ) ENDIF() ELSE() + SET(PROJECT_LIBS + ${server_SOURCE_DIR}/zeromq/libzmq.lib + ${PROJECT_LIBS} + ) + include_directories ( + ${include_directories} + ${server_SOURCE_DIR}/zeromq + ) + install(PROGRAMS ${server_SOURCE_DIR}/zeromq/libzmq.dll DESTINATION ".") + ENDIF() DFHACK_PLUGIN(server ${PROJECT_SRCS} LINK_LIBRARIES ${PROJECT_LIBS}) add_executable ( helloclient hello.cpp ) -target_link_libraries ( helloclient ${server_SOURCE_DIR}/zeromq/libzmq.so.1) +target_link_libraries ( helloclient ${PROJECT_LIBS}) install(TARGETS helloclient RUNTIME DESTINATION . ) \ No newline at end of file diff --git a/plugins/server/hello.cpp b/plugins/server/hello.cpp index 26b157c10..7afffb0b1 100644 --- a/plugins/server/hello.cpp +++ b/plugins/server/hello.cpp @@ -6,14 +6,14 @@ #include #include #include -#include +//#include int main (void) { void *context = zmq_init (1); // Socket to talk to server - printf ("Connecting to hello world server…\n"); + printf ("Connecting to hello world server...\n"); void *requester = zmq_socket (context, ZMQ_REQ); zmq_connect (requester, "tcp://localhost:5555"); @@ -23,7 +23,7 @@ int main (void) zmq_msg_t request; zmq_msg_init_size (&request, 5); memcpy (zmq_msg_data (&request), "Hello", 5); - printf ("Sending Hello %d…\n", request_nbr); + printf ("Sending Hello %d...\n", request_nbr); zmq_send (requester, &request, 0); zmq_msg_close (&request); diff --git a/plugins/server/main.cpp b/plugins/server/main.cpp index 061252df5..b47128c50 100644 --- a/plugins/server/main.cpp +++ b/plugins/server/main.cpp @@ -3,6 +3,9 @@ #include #include #include +#ifndef LINUX_BUILD +#include +#endif using namespace DFHack; // Here go all the command declarations... @@ -64,7 +67,11 @@ DFhackCExport command_result server (Core * c, std::vector & param c->con.print("Received Hello\n"); // Do some 'work' +#ifdef LINUX_BUILD sleep (1); +#else + Sleep(1000); +#endif // Send reply back to client zmq::message_t reply (5); diff --git a/plugins/server/zeromq/libzmq.dll b/plugins/server/zeromq/libzmq.dll new file mode 100644 index 000000000..8452ab8e6 Binary files /dev/null and b/plugins/server/zeromq/libzmq.dll differ diff --git a/plugins/server/zeromq/libzmq.exp b/plugins/server/zeromq/libzmq.exp new file mode 100644 index 000000000..97c4e31d8 Binary files /dev/null and b/plugins/server/zeromq/libzmq.exp differ diff --git a/plugins/server/zeromq/libzmq.lib b/plugins/server/zeromq/libzmq.lib new file mode 100644 index 000000000..968556cba Binary files /dev/null and b/plugins/server/zeromq/libzmq.lib differ