travis_osx_script.sh 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. set -ev
  3. echo "Documentation and certificate build"
  4. mkdir -p build
  5. cd build
  6. cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCUMENTATION=ON -DGENERATE_SELFSIGNED=ON ..
  7. make doc
  8. make selfsigned
  9. cp -r doc ..
  10. cp server_cert.der ..
  11. echo "Testing builds"
  12. cd .. && rm -rf build && mkdir -p build && cd build
  13. echo "Compile release build for OS X"
  14. cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_AMALGAMATION=ON -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
  15. make
  16. 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
  17. cp open62541-osx.tar.gz ..
  18. cp open62541.h .. #copy single file-release
  19. cp open62541.c .. #copy single file-release
  20. cd .. && rm -rf build && mkdir -p build && cd build
  21. echo "Compile multithreaded version"
  22. cmake -DENABLE_MULTITHREADING=ON -DBUILD_EXAMPLESERVER=ON ..
  23. make
  24. cd .. && rm -rf build && mkdir -p build && cd build
  25. echo "Debug build and unit tests (64 bit)"
  26. cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_DEMO_NODESET=ON -DBUILD_UNIT_TESTS=ON -DBUILD_EXAMPLESERVER=ON -DENABLE_COVERAGE=ON ..
  27. make && make test
  28. echo "Run valgrind to see if the server leaks memory (just starting up and closing..)"
  29. (valgrind --error-exitcode=3 ./server & export pid=$!; sleep 2; kill -INT $pid; wait $pid);
  30. cd ..