script.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash -e
  2. if [[ $PLATFORM == "Linux" ]]; then
  3. mkdir -p travisbuild
  4. cd travisbuild
  5. CMAKE_FLAGS='-DCMAKE_BUILD_TYPE=Debug \
  6. -DRUN_IN_PLACE=TRUE \
  7. -DENABLE_GETTEXT=TRUE'
  8. # Clang builds with FreeType fail on Travis
  9. if [[ $CC == "clang" ]]; then
  10. CMAKE_FLAGS+=' -DENABLE_FREETYPE=FALSE'
  11. fi
  12. cmake $CMAKE_FLAGS ..
  13. make -j2
  14. echo "Running unit tests."
  15. ../bin/minetest --run-unittests && exit 0
  16. elif [[ $PLATFORM == Win* ]]; then
  17. [[ $CC == "clang" ]] && exit 1 # Not supposed to happen
  18. # We need to have our build directory outside of the minetest directory because
  19. # CMake will otherwise get very very confused with symlinks and complain that
  20. # something is not a subdirectory of something even if it actually is.
  21. # e.g.:
  22. # /home/travis/minetest/minetest/travisbuild/minetest
  23. # \/ \/ \/
  24. # /home/travis/minetest/minetest/travisbuild/minetest/travisbuild/minetest
  25. # \/ \/ \/
  26. # /home/travis/minetest/minetest/travisbuild/minetest/travisbuild/minetest/travisbuild/minetest
  27. # You get the idea.
  28. OLDDIR=$(pwd)
  29. cd ..
  30. export EXISTING_MINETEST_DIR=$OLDDIR
  31. export NO_MINETEST_GAME=1
  32. if [[ $PLATFORM == "Win32" ]]; then
  33. $OLDDIR/util/buildbot/buildwin32.sh travisbuild && exit 0
  34. elif [[ $PLATFORM == "Win64" ]]; then
  35. $OLDDIR/util/buildbot/buildwin64.sh travisbuild && exit 0
  36. fi
  37. else
  38. echo "Unknown platform \"${PLATFORM}\"."
  39. exit 1
  40. fi