Explorar el Código

amalagated server compile with multi-threading on

Stasik0 hace 9 años
padre
commit
dddd77ba8c
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. 1 1
      CMakeLists.txt
  2. 3 0
      examples/server.c

+ 1 - 1
CMakeLists.txt

@@ -192,7 +192,7 @@ endif()
 ## multithreading
 option(ENABLE_MULTITHREADING "Enable multithreading (experimental)" OFF)
 if(ENABLE_MULTITHREADING)
-    add_definitions(-DUA_MULTITHREADING)
+	set(UA_MULTITHREADING ON) #to propagate it to the config file
     find_package(Threads REQUIRED)
     list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_concurrent.c)
 else()

+ 3 - 0
examples/server.c

@@ -2,6 +2,9 @@
  * This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
  */
+//to compile with single file releases:
+// * single-threaded: gcc -std=c99 server.c open62541.c -o server
+// * multi-threaded: gcc -std=c99 server.c open62541.c -o server -lurcu-cds -lurcu -lurcu-common -lpthread
 
 #ifdef UA_NO_AMALGAMATION
 # include <time.h>