travis_osx_script.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. set -e
  3. echo "\n=== Building ==="
  4. export OPENSSL_ROOT_DIR="/usr/local/opt/openssl"
  5. export PATH="/Users/travis/Library/Python/2.7/bin:$PATH"
  6. echo "Documentation and certificate build" && echo -en 'travis_fold:start:script.build.doc\\r'
  7. mkdir -p build && cd build
  8. cmake -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DUA_BUILD_SELFSIGNED_CERTIFICATE=ON ..
  9. make selfsigned
  10. ls examples
  11. cp examples/server_cert.der ../
  12. cd .. && rm -rf build
  13. echo -en 'travis_fold:end:script.build.doc\\r'
  14. echo "Full Namespace 0 Generation" && echo -en 'travis_fold:start:script.build.ns0\\r'
  15. mkdir -p build
  16. cd build
  17. cmake -DCMAKE_BUILD_TYPE=Debug -DUA_ENABLE_FULL_NS0=ON -DUA_BUILD_EXAMPLES=ON ..
  18. make -j
  19. cd .. && rm -rf build
  20. echo -en 'travis_fold:end:script.build.ns0\\r'
  21. echo "Compile release build for OS X" && echo -en 'travis_fold:start:script.build.osx\\r'
  22. mkdir -p build && cd build
  23. cmake -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLES=ON ..
  24. make -j
  25. tar -pczf open62541-osx.tar.gz ../LICENSE ../AUTHORS ../README.md ./bin/examples/server ./bin/examples/client ./bin/libopen62541.a open62541.h open62541.c
  26. cp open62541-osx.tar.gz ..
  27. cp open62541.h .. #copy single file-release
  28. cp open62541.c .. #copy single file-release
  29. cd .. && rm -rf build
  30. echo -en 'travis_fold:end:script.build.osx\\r'
  31. echo "Compile multithreaded version" && echo -en 'travis_fold:start:script.build.multithread\\r'
  32. mkdir -p build && cd build
  33. cmake -DUA_ENABLE_MULTITHREADING=ON -DUA_BUILD_EXAMPLES=ON ..
  34. make -j
  35. cd .. && rm -rf build
  36. echo -en 'travis_fold:end:script.build.multithread\\r'
  37. echo "Debug build and unit tests with valgrind" && echo -en 'travis_fold:start:script.build.unit_test\\r'
  38. mkdir -p build && cd build
  39. cmake -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_EXAMPLES=ON -DUA_ENABLE_DISCOVERY=ON -DUA_ENABLE_DISCOVERY_MULTICAST=ON -DUA_BUILD_UNIT_TESTS=ON -DUA_ENABLE_COVERAGE=ON -DUA_ENABLE_UNIT_TESTS_MEMCHECK=ON ..
  40. make -j && make test ARGS="-V"
  41. cd .. && rm -rf build
  42. echo -en 'travis_fold:end:script.build.unit_test\\r'