travis_osx_script.sh 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. export OPENSSL_ROOT_DIR="/usr/local/opt/openssl"
  9. export PATH="/Users/travis/Library/Python/2.7/bin:$PATH"
  10. echo "Documentation and certificate build" && echo -en 'travis_fold:start:script.build.doc\\r'
  11. mkdir -p build && cd build
  12. cmake -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DUA_BUILD_SELFSIGNED_CERTIFICATE=ON ..
  13. make selfsigned
  14. ls examples
  15. cp examples/server_cert.der ../
  16. cd .. && rm -rf build
  17. echo -en 'travis_fold:end:script.build.doc\\r'
  18. echo "Full Namespace 0 Generation" && echo -en 'travis_fold:start:script.build.ns0\\r'
  19. mkdir -p build
  20. cd build
  21. cmake -DCMAKE_BUILD_TYPE=Debug -DUA_ENABLE_GENERATE_NAMESPACE0=On -DUA_BUILD_EXAMPLES=ON ..
  22. make -j
  23. cd .. && rm -rf build
  24. echo -en 'travis_fold:end:script.build.ns0\\r'
  25. echo "Compile release build for OS X" && echo -en 'travis_fold:start:script.build.osx\\r'
  26. mkdir -p build && cd build
  27. cmake -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLES=ON ..
  28. make -j
  29. tar -pczf open62541-osx.tar.gz ../LICENSE ../AUTHORS ../README.md ./bin/examples/server ./bin/examples/client ./bin/libopen62541.a open62541.h open62541.c
  30. cp open62541-osx.tar.gz ..
  31. cp open62541.h .. #copy single file-release
  32. cp open62541.c .. #copy single file-release
  33. cd .. && rm -rf build
  34. echo -en 'travis_fold:end:script.build.osx\\r'
  35. echo "Compile multithreaded version" && echo -en 'travis_fold:start:script.build.multithread\\r'
  36. mkdir -p build && cd build
  37. cmake -DUA_ENABLE_MULTITHREADING=ON -DUA_BUILD_EXAMPLESERVER=ON -DUA_BUILD_EXAMPLES=ON ..
  38. make -j
  39. cd .. && rm -rf build
  40. echo -en 'travis_fold:end:script.build.multithread\\r'
  41. echo "Debug build and unit tests with valgrind" && echo -en 'travis_fold:start:script.build.unit_test\\r'
  42. mkdir -p build && cd build
  43. 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=OFF -DUA_ENABLE_VALGRIND_UNIT_TESTS=OFF ..
  44. make -j && make test ARGS="-V"
  45. cd .. && rm -rf build
  46. echo -en 'travis_fold:end:script.build.unit_test\\r'
  47. fi