Browse Source

Fix header and crosscompilation as static library

Jose Cabral 5 years ago
parent
commit
fd5a85a290

+ 1 - 0
CMakeLists.txt

@@ -929,6 +929,7 @@ assign_source_group(${ua_architecture_sources})
 if(UA_ENABLE_AMALGAMATION)
     add_library(open62541-object OBJECT ${PROJECT_BINARY_DIR}/open62541.c ${PROJECT_BINARY_DIR}/open62541.h)
     target_include_directories(open62541-object PRIVATE ${PROJECT_BINARY_DIR})
+    target_include_directories(open62541-object PRIVATE "${ua_architecture_directories_to_include}")
     if(UA_ENABLE_ENCRYPTION)
         target_include_directories(open62541-object PRIVATE ${MBEDTLS_INCLUDE_DIRS})
     endif()

+ 1 - 1
arch/Readme.md

@@ -48,7 +48,7 @@ To port to a new architecture you should follow these steps:
     # ---- End of the CMakeLists.txt template -----
     # ---------------------------------------------------
     ```
-5. Create a ua_clock.c file that implements the following functions defined in ua_types.h:
+5. Create a ua_clock.c file that implements the following functions defined in open62541/types.h:
 
    * UA_DateTime UA_DateTime_now(void);
    

+ 4 - 1
arch/eCos/ua_architecture_functions.c

@@ -4,8 +4,9 @@
  *    Copyright 2018 (c) Jose Cabral, fortiss GmbH
  */
 
-#include "ua_types.h"
+#ifdef UA_ARCHITECTURE_ECOS
 
+#include <open62541/types.h>
 
 unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){
   int on = 0;
@@ -35,3 +36,5 @@ int gethostname_ecos(char* name, size_t len){
   strcpy(name, UA_ECOS_HOSTNAME);
   return 0;
 }
+
+#endif /* UA_ARCHITECTURE_ECOS */

+ 5 - 1
arch/eCos/ua_clock.c

@@ -4,7 +4,9 @@
  *    Copyright 2018 (c) Jose Cabral, fortiss GmbH
  */
 
-#include "ua_types.h"
+#ifdef UA_ARCHITECTURE_ECOS
+
+#include <open62541/types.h>
 
 UA_DateTime UA_DateTime_now(void) {
   return UA_DateTime_nowMonotonic();
@@ -33,3 +35,5 @@ UA_DateTime UA_DateTime_nowMonotonic(void) {
   ts.tv_nsec = (UATime.milliSec % 1000) * 1000000;
   return (ts.tv_sec * UA_DATETIME_SEC) + (ts.tv_nsec / 100) + UA_DATETIME_UNIX_EPOCH;
 }
+
+#endif /* UA_ARCHITECTURE_ECOS */

+ 1 - 0
arch/freertosLWIP/CMakeLists.txt

@@ -10,6 +10,7 @@ if (${_index} GREATER -1 OR "${UA_ARCHITECTURE}" STREQUAL "freertosLWIP")
 
     if("${UA_ARCHITECTURE}" STREQUAL "freertosLWIP")
         ua_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+        ua_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common)
         set(UA_ARCH_FREERTOS_USE_OWN_MEMORY_FUNCTIONS OFF CACHE BOOL "Enable free/malloc/etc from own implementation")
         if(UA_ARCH_FREERTOS_USE_OWN_MEMORY_FUNCTIONS)
           ua_architecture_add_definitions("-DOPEN62541_FEERTOS_USE_OWN_MEM")

+ 1 - 1
arch/freertosLWIP/ua_architecture_functions.c

@@ -7,7 +7,7 @@
 
 #ifdef UA_ARCHITECTURE_FREERTOSLWIP
 
-#include "ua_types.h"
+#include <open62541/types.h>
 
 unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){
   int on = 0;

+ 1 - 1
arch/freertosLWIP/ua_clock.c

@@ -8,7 +8,7 @@
 
 #ifdef UA_ARCHITECTURE_FREERTOSLWIP
 
-#include "ua_types.h"
+#include <open62541/types.h>
 #include <task.h>
 
 /* The current time in UTC time */

+ 1 - 1
arch/vxworks/ua_architecture_functions.c

@@ -6,7 +6,7 @@
 
 #ifdef UA_ARCHITECTURE_VXWORKS
 
-#include "ua_types.h"
+#include <open62541/types.h>
 
 unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){
   int on = FALSE;

+ 1 - 1
arch/vxworks/ua_clock.c

@@ -20,7 +20,7 @@
 #include <time.h>
 #include <sys/time.h>
 
-#include "ua_types.h"
+#include <open62541/types.h>
 
 UA_DateTime UA_DateTime_now(void){
   struct timeval tv;

+ 1 - 1
arch/wec7/ua_architecture_functions.c

@@ -6,7 +6,7 @@
 
 #ifdef UA_ARCHITECTURE_WEC7
 
-#include "ua_types.h"
+#include <open62541/types.h>
 
 #undef UA_fileExists
 UA_Boolean UA_fileExists(const char* path) {

+ 1 - 1
arch/wec7/ua_clock.c

@@ -10,7 +10,7 @@
 # define _BSD_SOURCE
 #endif
 
-#include "ua_types.h"
+#include <open62541/types.h>
 #include <time.h>
 /* Backup definition of SLIST_ENTRY on mingw winnt.h */
 # ifdef SLIST_ENTRY