travis_osx_script.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 "Full Namespace 0 Generation" && echo -en 'travis_fold:start:script.build.ns0\\r'
  7. mkdir -p build
  8. cd build
  9. cmake \
  10. -DCMAKE_BUILD_TYPE=Debug \
  11. -DUA_BUILD_EXAMPLES=ON \
  12. -DUA_NAMESPACE_ZERO=FULL ..
  13. make -j
  14. if [ $? -ne 0 ] ; then exit 1 ; fi
  15. cd .. && rm -rf build
  16. echo -en 'travis_fold:end:script.build.ns0\\r'
  17. echo "Compile release build for OS X" && echo -en 'travis_fold:start:script.build.osx\\r'
  18. mkdir -p build && cd build
  19. cmake \
  20. -DCMAKE_BUILD_TYPE=Release \
  21. -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-osx \
  22. -DUA_BUILD_EXAMPLES=ON \
  23. -DUA_ENABLE_AMALGAMATION=OFF ..
  24. make -j
  25. if [ $? -ne 0 ] ; then exit 1 ; fi
  26. make install
  27. if [ $? -ne 0 ] ; then exit 1 ; fi
  28. cd ..
  29. tar -pczf open62541-osx.tar.gz LICENSE AUTHORS README.md ${TRAVIS_BUILD_DIR}/open62541-osx/*
  30. rm -rf build
  31. echo -en 'travis_fold:end:script.build.osx\\r'
  32. echo "Compile multithreaded version" && echo -en 'travis_fold:start:script.build.multithread\\r'
  33. mkdir -p build && cd build
  34. cmake \
  35. -DUA_BUILD_EXAMPLES=ON \
  36. -DUA_ENABLE_MULTITHREADING=ON ..
  37. make -j
  38. if [ $? -ne 0 ] ; then exit 1 ; fi
  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 \
  44. -DCHECK_PREFIX=/usr/local/Cellar/check/0.11.0 \
  45. -DCMAKE_BUILD_TYPE=Debug \
  46. -DUA_BUILD_EXAMPLES=ON \
  47. -DUA_BUILD_UNIT_TESTS=ON \
  48. -DUA_ENABLE_COVERAGE=OFF \
  49. -DUA_ENABLE_DISCOVERY=ON \
  50. -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
  51. -DUA_ENABLE_ENCRYPTION=ON \
  52. -DUA_ENABLE_UNIT_TESTS_MEMCHECK=OFF ..
  53. make -j && make test ARGS="-V"
  54. if [ $? -ne 0 ] ; then exit 1 ; fi
  55. cd .. && rm -rf build
  56. echo -en 'travis_fold:end:script.build.unit_test\\r'