Browse Source

fix windows build, always generate the single source distribution

Julius Pfrommer 10 years ago
parent
commit
b23ecd76f4
3 changed files with 20 additions and 15 deletions
  1. 4 1
      CMakeLists.txt
  2. 1 1
      README.md
  3. 15 13
      examples/networklayer_tcp.c

+ 4 - 1
CMakeLists.txt

@@ -153,7 +153,10 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.h ${PROJECT_BINARY_DIR
                                                                               ${PROJECT_SOURCE_DIR}/examples/networklayer_tcp.c
                                                                               ${PROJECT_SOURCE_DIR}/examples/logger_stdout.c
                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${exported_headers} ${internal_headers}
-                       ${PROJECT_BINARY_DIR}/src_generated/ua_config.h ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc ${lib_sources})
+                       ${PROJECT_BINARY_DIR}/src_generated/ua_config.h ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc ${lib_sources}
+                       ${PROJECT_SOURCE_DIR}/examples/networklayer_tcp.c ${PROJECT_SOURCE_DIR}/examples/logger_stdout.c)
+
+add_custom_target(amalgamation ALL DEPENDS ${PROJECT_BINARY_DIR}/open62541.h ${PROJECT_BINARY_DIR}/open62541.c)
 if(ENABLE_AMALGAMATION)
     add_library(open62541-object OBJECT ${PROJECT_BINARY_DIR}/open62541.c)
     include_directories(${PROJECT_BINARY_DIR})

File diff suppressed because it is too large
+ 1 - 1
README.md


+ 15 - 13
examples/networklayer_tcp.c

@@ -3,21 +3,14 @@
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
  */
 
-/* amalgamation removes these includes */
-#define _XOPEN_SOURCE 500 //some users need this for some reason
-#define __USE_BSD
-#include <stdlib.h> // malloc, free
-#include <stdio.h>
-#include <string.h> // memset
-#include "networklayer_tcp.h" // UA_MULTITHREADING is defined in here
-#ifdef UA_MULTITHREADING
-# include <urcu/uatomic.h>
+#ifdef NOT_AMALGATED
+# define _XOPEN_SOURCE 500 //some users need this for some reason
+# define __USE_BSD
+# include <stdlib.h> // malloc, free
+# include <stdio.h>
+# include <string.h> // memset
 #endif
 
-/* with a space so amalgamation does not remove the includes */
-# include <errno.h> // errno, EINTR
-# include <fcntl.h> // fcntl
-
 #ifdef _WIN32
 # include <malloc.h>
 # include <winsock2.h>
@@ -37,6 +30,15 @@
 # define CLOSESOCKET(S) close(S)
 #endif
 
+#include "networklayer_tcp.h" // UA_MULTITHREADING is defined in here
+#ifdef UA_MULTITHREADING
+# include <urcu/uatomic.h>
+#endif
+
+/* with a space so amalgamation does not remove the includes */
+# include <errno.h> // errno, EINTR
+# include <fcntl.h> // fcntl
+
 struct ServerNetworklayer_TCP;
 
 /* Forwarded to the server as a (UA_Connection) and used for callbacks back into