travis_osx_script.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_EXAMPLESERVER=OFF -DUA_BUILD_EXAMPLECLIENT=OFF -DUA_BUILD_EXAMPLES=OFF -DUA_BUILD_DOCUMENTATION=OFF -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_EXAMPLESERVER=ON -DUA_BUILD_EXAMPLECLIENT=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 server_static server client_static client libopen62541.dylib 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_EXAMPLESERVER=ON ..
  26. make -j8
  27. cd .. && rm -rf build
  28. echo "Debug build and unit tests (64 bit)"
  29. mkdir -p build && cd build
  30. cmake -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_DEMO_NODESET=ON -DUA_BUILD_UNIT_TESTS=ON -DUA_BUILD_EXAMPLESERVER=ON -DUA_ENABLE_COVERAGE=ON ..
  31. make -j8 && make test
  32. echo "Run valgrind to see if the server leaks memory (just starting up and closing..)"
  33. (valgrind --error-exitcode=3 ./server & export pid=$!; sleep 2; kill -INT $pid; wait $pid);
  34. cd .. && rm -rf build
  35. fi