Browse Source

adding an explicitely statically and dynamically linked exes

Stasik0 10 years ago
parent
commit
9c24b4874b
2 changed files with 20 additions and 20 deletions
  1. 5 5
      .travis.yml
  2. 15 15
      CMakeLists.txt

+ 5 - 5
.travis.yml

@@ -36,26 +36,26 @@ script:
 - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
 - make -j
 - cp ../README.md .
-- zip open62541-win32.zip README.md exampleServer.exe exampleClient.exe libopen62541.dll libopen62541.dll.a open62541.h open62541.c
+- zip open62541-win32.zip README.md exampleServer_static.exe exampleServer.exe exampleClient.exe exampleClient_static.exe libopen62541.dll libopen62541.dll.a open62541.h open62541.c
 - cp open62541-win32.zip ..
 - cd .. && rm build -rf && mkdir -p build && cd build
 - echo "Cross compile release build for MinGW 64 bit"
 - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
 - make -j
 - cp ../README.md .
-- zip open62541-win64.zip README.md exampleServer.exe exampleClient.exe libopen62541.dll libopen62541.dll.a open62541.h open62541.c
+- zip open62541-win64.zip README.md exampleServer_static.exe exampleServer.exe exampleClient.exe exampleClient_static.exe libopen62541.dll libopen62541.dll.a open62541.h open62541.c
 - cp open62541-win64.zip ..
 - cd .. && rm build -rf && mkdir -p build && cd build
 - echo "Cross compile release build for 32-bit linux"
 - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-gcc-m32.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
 - make -j
-- tar -pczf open62541-linux32.tar.gz ../README.md exampleServer exampleClient libopen62541.so open62541.h open62541.c
+- tar -pczf open62541-linux32.tar.gz ../README.md exampleServer_static exampleServer exampleClient_static exampleClient libopen62541.so open62541.h open62541.c
 - cp open62541-linux32.tar.gz ..
 - cd .. && rm build -rf && mkdir -p build && cd build
 - echo "Compile release build for 64-bit linux"
 - cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_AMALGAMATION=ON -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
 - make -j
-- tar -pczf open62541-linux64.tar.gz ../README.md exampleServer exampleClient libopen62541.so open62541.h open62541.c
+- tar -pczf open62541-linux64.tar.gz ../README.md exampleServer_static exampleServer exampleClient_static exampleClient libopen62541.so open62541.h open62541.c
 - cp open62541-linux64.tar.gz ..
 - cp open62541.h .. #copy single file-release
 - cp open62541.c .. #copy single file-release
@@ -93,7 +93,7 @@ before_deploy:
 - export PATH=$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/
 - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-rpi64.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
 - make -j
-- tar -pczf open62541-raspberrypi.tar.gz ../README.md exampleServer exampleClient libopen62541.so open62541.h open62541.c
+- tar -pczf open62541-raspberrypi.tar.gz ../README.md exampleServer_static exampleServer exampleClient_static exampleClient libopen62541.so open62541.h open62541.c
 - cp open62541-raspberrypi.tar.gz ..
 - cd ..
 deploy:

+ 15 - 15
CMakeLists.txt

@@ -204,23 +204,23 @@ if(BUILD_EXAMPLESERVER)
     #if(NOT ENABLE_AMALGAMATION)
     #    list(APPEND server_source examples/networklayer_tcp.c examples/logger_stdout.c)
     #endif()
-    add_executable(exampleServer examples/server.c ${server_source})
+    add_executable(exampleServer_static examples/server.c ${server_source})
     add_executable(exampleServer_simple examples/server_simple.c ${server_source})
-    add_executable(exampleServer_so examples/server.c)
-	target_link_libraries(exampleServer_so open62541)
+    add_executable(exampleServer examples/server.c)
+	target_link_libraries(exampleServer open62541)
     if(WIN32)
-        target_link_libraries(exampleServer ws2_32)
+        target_link_libraries(exampleServer_static ws2_32)
         target_link_libraries(exampleServer_simple ws2_32)
-        target_link_libraries(exampleServer_so ws2_32)
+        target_link_libraries(exampleServer ws2_32)
     else()
-        target_link_libraries(exampleServer rt)
+        target_link_libraries(exampleServer_static rt)
         target_link_libraries(exampleServer_simple rt)
-        target_link_libraries(exampleServer_so rt)
+        target_link_libraries(exampleServer rt)
     endif()
     if(ENABLE_MULTITHREADING)
-        target_link_libraries(exampleServer urcu-cds urcu urcu-common pthread)
+        target_link_libraries(exampleServer_static urcu-cds urcu urcu-common pthread)
         target_link_libraries(exampleServer_simple urcu-cds urcu urcu-common pthread)
-        target_link_libraries(exampleServer_so urcu-cds urcu urcu-common pthread)
+        target_link_libraries(exampleServer urcu-cds urcu urcu-common pthread)
     endif()
 endif()
 
@@ -244,19 +244,19 @@ if(BUILD_EXAMPLECLIENT)
     #if(NOT ENABLE_AMALGAMATION)
     #    list(APPEND client_source examples/networklayer_tcp.c examples/logger_stdout.c)
     #endif()
-	add_executable(exampleClient examples/client.c ${client_source})
-	add_executable(exampleClient_so examples/client.c)
-	target_link_libraries(exampleClient_so open62541)
+	add_executable(exampleClient_static examples/client.c ${client_source})
+	add_executable(exampleClient examples/client.c)
+	target_link_libraries(exampleClient open62541)
     if(WIN32)
+        target_link_libraries(exampleClient_static ws2_32)
         target_link_libraries(exampleClient ws2_32)
-        target_link_libraries(exampleClient_so ws2_32)
     else()
+        target_link_libraries(exampleClient_static rt)
         target_link_libraries(exampleClient rt)
-        target_link_libraries(exampleClient_so rt)
     endif()
     if(ENABLE_MULTITHREADING)
+        target_link_libraries(exampleClient_static urcu-cds urcu urcu-common pthread)
         target_link_libraries(exampleClient urcu-cds urcu urcu-common pthread)
-        target_link_libraries(exampleClient_so urcu-cds urcu urcu-common pthread)
     endif()
     if(EXTENSION_STATELESS)
         add_executable(statelessClient examples/client_stateless.c ${client_source})