travis-build-cpp.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. set -euo pipefail
  3. export WXVERSION=pkg
  4. export DISPLAY=:99.0
  5. mkdir -p $CACHE
  6. ( sudo Xvfb :99 -ac -screen 0 1024x768x8; echo ok )&
  7. brew update -v
  8. brew install ccache || brew upgrade ccache
  9. brew install coreutils || brew upgrade coreutils
  10. if [[ "$WXVERSION" != "pkg" ]]; then
  11. WXVER_EXPANDED=${WXVERSION:0:1}.${WXVERSION:1:1}.${WXVERSION:2:1}
  12. export WXDIR=$HOME/wx${WXVERSION}
  13. if [ ! -e $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 ]; then
  14. curl -L "https://github.com/wxWidgets/wxWidgets/releases/download/v${WXVER_EXPANDED}/wxWidgets-${WXVER_EXPANDED}.tar.bz2" -o $HOME/wx${WXVERSION}-src.tar.bz2
  15. tar -C$HOME -xjf $HOME/wx${WXVERSION}-src.tar.bz2
  16. mkdir $WXDIR
  17. cd $HOME/$WXDIR && cmake $HOME/wxWidgets-${WXVER_EXPANDED} -DwxBUILD_SHARED=OFF
  18. cmake --build . --target -- -j4
  19. tar -C$HOME -cjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 $(basename ${WXDIR})
  20. else
  21. tar -C$HOME -xjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2
  22. fi
  23. export PATH=${PATH}:${WXDIR}
  24. cd $TRAVIS_BUILD_DIR # go back to the build dir
  25. else
  26. brew install wxmac || brew upgrade wxmac # install via homebrew
  27. fi
  28. mkdir build && cd build
  29. cmake -DBOOST_ROOT=$HOME/boost_1_63_0 -DSLIC3R_STATIC=ON -DCMAKE_BUILD_TYPE=Release ../src
  30. cmake --build .
  31. ./slic3r_test -s
  32. #./gui_test -s