Browse Source

one more try to get stuff fixed

Stasik0 9 years ago
parent
commit
a8df8ec31e
3 changed files with 15 additions and 10 deletions
  1. 7 2
      CMakeLists.txt
  2. 7 7
      examples/server_datasource.c
  3. 1 1
      src/server/ua_server_internal.h

+ 7 - 2
CMakeLists.txt

@@ -105,7 +105,7 @@ set(UA_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported")
 ## multithreading
 option(ENABLE_MULTITHREADING "Enable multithreading" OFF)
 if(ENABLE_MULTITHREADING)
-    set(UA_MULTITHREADING ON)
+    add_definitions(-DUA_MULTITHREADING)
     find_package(Threads REQUIRED)
     list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_concurrent.c)
 else()
@@ -118,7 +118,7 @@ configure_file("src/ua_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/ua_conf
 ## extensions
 option(EXTENSION_UDP "Enable udp extension" OFF)
 if(EXTENSION_UDP)
-	set(EXTENSION_STATELESS ON)
+	add_definitions(-DEXTENSION_STATELESS)
 	message(STATUS "Extensions: enabling udp")
 	add_definitions(-DEXTENSION_UDP)
 endif()
@@ -220,6 +220,11 @@ if(BUILD_EXAMPLECLIENT)
     if(ENABLE_MULTITHREADING)
         target_link_libraries(exampleClient urcu-cds urcu urcu-common pthread)
     endif()
+    if(WIN32)
+        target_link_libraries(exampleClient ws2_32)
+    else()
+        target_link_libraries(exampleClient rt)
+    endif()
     if ((CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") AND (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" OR CMAKE_BUILD_TYPE STREQUAL "Release"))
     	add_custom_command(TARGET exampleClient POST_BUILD COMMAND ${CMAKE_STRIP} $<TARGET_FILE:exampleClient>)
 	endif()

+ 7 - 7
examples/server_datasource.c

@@ -2,6 +2,13 @@
  * This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
  */
+#ifdef NOT_AMALGATED
+    #include "ua_types.h"
+    #include "ua_server.h"
+#else
+    #include "open62541.h"
+#endif
+
 #include <time.h>
 #include <stdio.h>
 #include <stdlib.h> 
@@ -11,13 +18,6 @@
 #include <pthread.h>
 #endif
 
-#ifdef NOT_AMALGATED
-    #include "ua_types.h"
-    #include "ua_server.h"
-#else
-    #include "open62541.h"
-#endif
-
 // provided by the user, implementations available in the /examples folder
 #include "logger_stdout.h"
 #include "networklayer_tcp.h"

+ 1 - 1
src/server/ua_server_internal.h

@@ -108,4 +108,4 @@ typedef enum {
         UA_Server_addReference(server, &item);                          \
     } while(0)
 
-#endif /* UA_SERVER_INTERNAL_H_ */
+#endif /* UA_SERVER_INTERNAL_H_ */