travis_osx_script.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. set -ev
  3. if [ $ANALYZE = "true" ]; then
  4. echo "\n=== Skipping static analysis on OS X ==="
  5. exit 0
  6. else
  7. echo "\n=== Building ==="
  8. echo "Create certificate for OS X build"
  9. mkdir -p build && cd build
  10. cmake -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_SELFSIGNED_CERTIFICATE=ON ..
  11. make selfsigned
  12. cp server_cert.der ../
  13. cd .. && rm -rf build
  14. echo "Compile release build for OS X"
  15. mkdir -p build && cd build
  16. cmake -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLES=ON -DUA_BUILD_DOCUMENTATION=ON -DUA_GENERATE_SELFSIGNED=ON ..
  17. make -j8
  18. tar -pczf open62541-osx.tar.gz ../doc ../server_cert.der ../LICENSE ../AUTHORS ../README.md examples/server examples/client libopen62541.a open62541.h open62541.c
  19. cp open62541-osx.tar.gz ..
  20. cp open62541.h .. #copy single file-release
  21. cp open62541.c .. #copy single file-release
  22. cd .. && rm -rf build
  23. echo "Compile multithreaded version"
  24. mkdir -p build && cd build
  25. cmake -DUA_ENABLE_MULTITHREADING=ON -DUA_BUILD_EXAMPLES=ON ..
  26. make -j
  27. cd .. && rm -rf build
  28. echo "Compile without discovery version"
  29. mkdir -p build && cd build
  30. cmake -DUA_ENABLE_DISCOVERY=OFF -DUA_BUILD_EXAMPLES=ON ..
  31. make -j
  32. cd .. && rm -rf build
  33. echo "Debug build and unit tests (64 bit)"
  34. mkdir -p build && cd build
  35. cmake -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_DEMO_NODESET=ON -DUA_BUILD_UNIT_TESTS=ON -DUA_BUILD_EXAMPLES=ON -DUA_ENABLE_COVERAGE=ON ..
  36. make -j8 && make test
  37. echo "Run valgrind to see if the server leaks memory (just starting up and closing..)"
  38. (valgrind --error-exitcode=3 ./server & export pid=$!; sleep 2; kill -INT $pid; wait $pid);
  39. cd .. && rm -rf build
  40. fi