Browse Source

Merge remote-tracking branch 'upstream/0.2'

# Conflicts:
#	appveyor.yml
#	examples/CMakeLists.txt
#	tools/travis/travis_linux_script.sh
Stefan Profanter 7 years ago
parent
commit
6bd9345979
5 changed files with 67 additions and 25 deletions
  1. 14 4
      .github/ISSUE_TEMPLATE
  2. 1 1
      CMakeLists.txt
  3. 14 3
      appveyor.yml
  4. 28 12
      examples/CMakeLists.txt
  5. 10 5
      tools/travis/travis_linux_script.sh

+ 14 - 4
.github/ISSUE_TEMPLATE

@@ -1,14 +1,24 @@
+!ATTENTION!
+Please read the following page carefully and provide us with all the
+information requested:
+https://github.com/open62541/open62541/wiki/Writing-Good-Issue-Reports
+
+Use Github Markdown to format your text:
+https://help.github.com/articles/basic-writing-and-formatting-syntax/
+
+Fill out the sections and checklist below (add text at the end of each line).
+
+Remove this text between the ATTENTION marks after reading it.
+!ATTENTION!
+--------------------------------------------------------------------------------
+
 Description
 ===========
 
 
-
 Background Information / Reproduction Steps
 ===========================================
 
-See here for the kinds of information we need to reproduce the bug and how to obtain it:
-https://github.com/open62541/open62541/wiki/Writing-Good-Issue-Reports
-
 
 
 Checklist

+ 1 - 1
CMakeLists.txt

@@ -29,7 +29,7 @@ include(AssignSourceGroup)
 set(OPEN62541_VER_MAJOR 0)
 set(OPEN62541_VER_MINOR 2)
 set(OPEN62541_VER_PATCH 0)
-set(OPEN62541_VER_LABEL "-rc2") # Appended to the X.Y.Z version format. For example "-rc1" or an empty string
+set(OPEN62541_VER_LABEL "") # Appended to the X.Y.Z version format. For example "-rc1" or an empty string
 
 # Set OPEN62541_VER_COMMIT
 if(GIT_FOUND)

+ 14 - 3
appveyor.yml

@@ -68,10 +68,21 @@ build_script:
   - md build
   - cd build
   - echo "Testing %CC_NAME% with amalgamation"
-  - cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -G"%CC_NAME%" ..
+  - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=OFF -G"%CC_NAME%" ..
   - '%MAKE%'
+  - 7z a -tzip open62541-%CC_SHORTNAME%-static.zip %APPVEYOR_BUILD_FOLDER%\build\*
+  - move open62541-%CC_SHORTNAME%-static.zip %APPVEYOR_BUILD_FOLDER%
+  - cd ..
+  - rd /s /q build
+  - md build
+  - cd build
+  - echo "Testing %CC_NAME% with amalgamation and .dll"
+  - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=ON -G"%CC_NAME%" ..
+  - '%MAKE%'
+  - 7z a -tzip open62541-%CC_SHORTNAME%-dynamic.zip %APPVEYOR_BUILD_FOLDER%\build\*
+  - move open62541-%CC_SHORTNAME%-dynamic.zip %APPVEYOR_BUILD_FOLDER%
   - cd ..
 
 after_build:
-  - 7z a open62541-%CC_SHORTNAME%.zip %APPVEYOR_BUILD_FOLDER%\build*
-  - appveyor PushArtifact open62541-%CC_SHORTNAME%.zip
+  - appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-static.zip
+  - appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-dynamic.zip

+ 28 - 12
examples/CMakeLists.txt

@@ -29,8 +29,15 @@ if(UA_ENABLE_MULTITHREADING)
   list(APPEND LIBS urcu-cds urcu urcu-common)
 endif(UA_ENABLE_MULTITHREADING)
 
+set(STATIC_OBJECTS $<TARGET_OBJECTS:open62541-object>)
+if(WIN32 AND BUILD_SHARED_LIBS)
+    # on windows the .dll.a file has to be used for the linker
+    list(APPEND LIBS open62541)
+    set(STATIC_OBJECTS "")
+endif()
+
 macro(add_example EXAMPLE_NAME EXAMPLE_SOURCE)
-  add_executable(${EXAMPLE_NAME} $<TARGET_OBJECTS:open62541-object> ${EXAMPLE_SOURCE})
+  add_executable(${EXAMPLE_NAME} ${STATIC_OBJECTS} ${EXAMPLE_SOURCE})
   target_link_libraries(${EXAMPLE_NAME} ${LIBS})
   assign_source_group(${EXAMPLE_SOURCE})
   add_dependencies(${EXAMPLE_NAME} open625451_amalgamation)
@@ -89,9 +96,10 @@ target_include_directories(server_readspeed PRIVATE ${PROJECT_SOURCE_DIR}/src ${
 
 add_example(server_inheritance server_inheritance.c)
 
-if(UA_BUILD_EXAMPLES_NODESET_COMPILER)
-  add_executable(server_nodeset "server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/nodeset.c")
-  target_include_directories(server_nodeset PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/deps) # needs an internal header
+if(NOT BUILD_SHARED_LIBS AND UA_BUILD_EXAMPLES_NODESET_COMPILER)
+    # needs internal methods which are not exported in the dynamic lib
+    add_example(server_nodeset "server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/nodeset.c")
+    target_include_directories(server_nodeset PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/deps) # needs an internal header
 endif()
 
 if(UA_BUILD_SELFSIGNED_CERTIFICATE)
@@ -101,17 +109,25 @@ if(UA_BUILD_SELFSIGNED_CERTIFICATE)
                      DEPENDS ${PROJECT_SOURCE_DIR}/tools/certs/create_self-signed.py
                              ${PROJECT_SOURCE_DIR}/tools/certs/localhost.cnf)
   add_custom_target(selfsigned ALL DEPENDS server_cert.der ca.crt)
-  add_executable(server_certificate server_certificate.c $<TARGET_OBJECTS:open62541-object> server_cert.der ca.crt)
+  add_executable(server_certificate server_certificate.c ${STATIC_OBJECTS} server_cert.der ca.crt)
   target_link_libraries(server_certificate ${LIBS})
 endif()
 
+if(NOT BUILD_SHARED_LIBS)
+  # needs internal methods which are not exported in the dynamic lib
+  add_executable(server_readspeed server_readspeed.c ${STATIC_OBJECTS})
+  target_include_directories(server_readspeed PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/deps) # needs an internal header
+  target_link_libraries(server_readspeed ${LIBS})
+endif()
+
+
 if(UA_ENABLE_DISCOVERY)
-  add_example(discovery_server_lds discovery/server_lds.c)
+    add_example(discovery_server_lds discovery/server_lds.c)
 
-  add_example(discovery_server_register discovery/server_register.c)
+    add_example(discovery_server_register discovery/server_register.c)
 
-  add_example(discovery_client_find_servers discovery/client_find_servers.c)
-  if(UA_ENABLE_DISCOVERY_MULTICAST)
-    add_example(discovery_server_multicast discovery/server_multicast.c)
-  endif()
-endif()
+    add_example(discovery_client_find_servers discovery/client_find_servers.c)
+    if(UA_ENABLE_DISCOVERY_MULTICAST)
+        add_example(discovery_server_multicast discovery/server_multicast.c)
+    endif()
+endif()

+ 10 - 5
tools/travis/travis_linux_script.sh

@@ -135,11 +135,16 @@ else
     cd .. && rm build -rf
 	echo -en 'travis_fold:end:script.build.example\\r'
 
-    echo -e "\r\n== Compile multithreaded version ==" && echo -en 'travis_fold:start:script.build.multithread\\r'
-    mkdir -p build && cd build
-    cmake -DUA_ENABLE_MULTITHREADING=ON -DUA_BUILD_EXAMPLES=ON ..
-    make -j
-    cd .. && rm build -rf
+	echo "Compile as shared lib version" && echo -en 'travis_fold:start:script.build.shared_libs\\r'
+	mkdir -p build && cd build
+	cmake -DBUILD_SHARED_LIBS=ON -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLES=ON ..
+	make -j
+	cd .. && rm build -rf
+	echo -en 'travis_fold:end:script.build.shared_libs\\r'echo -e "\r\n==Compile multithreaded version==" && echo -en 'travis_fold:start:script.build.multithread\\r'
+	mkdir -p build && cd build
+	cmake -DUA_ENABLE_MULTITHREADING=ON -DUA_BUILD_EXAMPLES=ON ..
+	make -j
+	cd .. && rm build -rf
 	echo -en 'travis_fold:end:script.build.multithread\\r'
 
     echo -e "\r\n== Compile without discovery version ==" && echo -en 'travis_fold:start:script.build.unit_test_valgrind\\r'