travis_osx_script.sh 2.0 KB

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