travis_osx_script.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 \
  9. # -DCMAKE_BUILD_TYPE=Release \
  10. # -DUA_BUILD_EXAMPLES=ON \
  11. # -DUA_BUILD_SELFSIGNED_CERTIFICATE=ON ..
  12. # make selfsigned
  13. # ls examples
  14. # cp examples/server_cert.der ../
  15. # cd .. && rm -rf build
  16. # echo -en 'travis_fold:end:script.build.doc\\r'
  17. echo "Full Namespace 0 Generation" && echo -en 'travis_fold:start:script.build.ns0\\r'
  18. mkdir -p build
  19. cd build
  20. cmake \
  21. -DCMAKE_BUILD_TYPE=Debug \
  22. -DUA_BUILD_EXAMPLES=ON \
  23. -DUA_NAMESPACE_ZERO=FULL ..
  24. make -j
  25. cd .. && rm -rf build
  26. echo -en 'travis_fold:end:script.build.ns0\\r'
  27. echo "Compile release build for OS X" && echo -en 'travis_fold:start:script.build.osx\\r'
  28. mkdir -p build && cd build
  29. cmake \
  30. -DCMAKE_BUILD_TYPE=Release \
  31. -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-osx \
  32. -DUA_BUILD_EXAMPLES=ON \
  33. -DUA_ENABLE_AMALGAMATION=OFF ..
  34. make -j
  35. make install
  36. cd ..
  37. tar -pczf open62541-osx.tar.gz LICENSE AUTHORS README.md ${TRAVIS_BUILD_DIR}/open62541-osx/*
  38. rm -rf build
  39. echo -en 'travis_fold:end:script.build.osx\\r'
  40. echo "Compile multithreaded version" && echo -en 'travis_fold:start:script.build.multithread\\r'
  41. mkdir -p build && cd build
  42. cmake \
  43. -DUA_BUILD_EXAMPLES=ON \
  44. -DUA_ENABLE_MULTITHREADING=ON ..
  45. make -j
  46. cd .. && rm -rf build
  47. echo -en 'travis_fold:end:script.build.multithread\\r'
  48. echo "Debug build and unit tests with valgrind" && echo -en 'travis_fold:start:script.build.unit_test\\r'
  49. mkdir -p build && cd build
  50. cmake \
  51. -DCHECK_PREFIX=/usr/local/Cellar/check/0.11.0 \
  52. -DCMAKE_BUILD_TYPE=Debug \
  53. -DUA_BUILD_EXAMPLES=ON \
  54. -DUA_BUILD_UNIT_TESTS=ON \
  55. -DUA_ENABLE_COVERAGE=ON \
  56. -DUA_ENABLE_DISCOVERY=ON \
  57. -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
  58. -DUA_ENABLE_ENCRYPTION=ON \
  59. -DUA_ENABLE_UNIT_TESTS_MEMCHECK=ON ..
  60. make -j && make test ARGS="-V"
  61. cd .. && rm -rf build
  62. echo -en 'travis_fold:end:script.build.unit_test\\r'