You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
6.2 KiB

  1. language: c
  2. dist: trusty
  3. git:
  4. depth: 3
  5. # TODO we could use a 32 bit Docker container for running true 32-bit tests
  6. services:
  7. - docker
  8. matrix:
  9. include:
  10. - os: linux
  11. env: ARCH=i386
  12. sudo: required
  13. - os: linux
  14. env: ARCH=amd64 INSTALL_GLFW=YES USE_EXTERNAL_GLFW=OFF
  15. sudo: required
  16. - os: linux
  17. env: ARCH=amd64 INSTALL_GLFW=YES STATIC=OFF RELEASE=NO
  18. sudo: required
  19. - os: linux
  20. env: WAYLAND=ON ARCH=amd64 RELEASE=NO
  21. sudo: required
  22. addons:
  23. apt:
  24. packages:
  25. - libwayland-dev
  26. - libxkbcommon-dev
  27. - libegl1-mesa-dev
  28. - os: osx
  29. env: ARCH=universal
  30. - os: osx
  31. osx_image: xcode9.4
  32. env: ARCH=universal SHARED=OFF RELEASE=NO
  33. - os: linux
  34. env: ARCH=arm64-android RELEASE=NO
  35. sudo: required
  36. - os: linux
  37. env: ARCH=arm32-android RELEASE=NO
  38. sudo: required
  39. - os: linux
  40. env: ARCH=html5 RELEASE=NO
  41. sudo: required
  42. - os: windows
  43. compiler: gcc
  44. env: ARCH=i386 SHARED=OFF RELEASE=NO
  45. before_script:
  46. before_install:
  47. - if [ -z "$USE_EXTERNAL_GLFW" ]; then export USE_EXTERNAL_GLFW=IF_POSSIBLE; fi
  48. - if [ -z "$SHARED" ]; then export SHARED=ON ; fi
  49. - if [ -z "$STATIC" ]; then export STATIC=ON ; fi
  50. - if [[ "$INSTALL_GLFW" == "YES" && "$USE_EXTERNAL_GLFW" != "OFF" ]]; then
  51. export DONT_TEST=1;
  52. fi
  53. - if [ "$TRAVIS_OS_NAME" == "linux" ]; then
  54. if [[ "$ARCH" == *-android ]]; then
  55. export DONT_TEST=1;
  56. export RAYLIB_PACKAGE_SUFFIX="-Android-arm64";
  57. wget https://dl.google.com/android/repository/android-ndk-r17-linux-x86_64.zip;
  58. unzip -qq android-ndk*.zip;
  59. if [[ "$ARCH" == arm64-* ]]; then
  60. export RAYLIB_PACKAGE_SUFFIX="-Android-arm64";
  61. TOOLCHAIN_ARCH=arm64;
  62. PREFIX=aarch64-linux-android-;
  63. else
  64. export RAYLIB_PACKAGE_SUFFIX="-Android-arm32";
  65. TOOLCHAIN_ARCH=arm;
  66. PREFIX=arm-linux-androideabi-;
  67. fi;
  68. android-ndk*/build/tools/make_standalone_toolchain.py --arch $TOOLCHAIN_ARCH --api 21 --install-dir /tmp/android-toolchain;
  69. export PATH=/tmp/android-toolchain/bin:$PATH;
  70. export CC=${PREFIX}clang;
  71. export CXX=${PREFIX}clang++;
  72. export CMAKE_ARCH_ARGS='-DPLATFORM=Android';
  73. elif [ "$ARCH" == "html5" ]; then
  74. export DONT_TEST=1;
  75. export RAYLIB_PACKAGE_SUFFIX="-html5";
  76. docker run --privileged=true -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash;
  77. export CMAKE_ARCH_ARGS='-DPLATFORM=Web -DCMAKE_TOOLCHAIN_FILE=../cmake/emscripten.cmake';
  78. RUNNER='docker exec -it emscripten cmake -E chdir build';
  79. else
  80. sudo apt-get install -y gcc-multilib
  81. libasound2-dev:$ARCH
  82. libxcursor-dev:$ARCH libxinerama-dev:$ARCH mesa-common-dev:$ARCH
  83. libx11-dev:$ARCH libxrandr-dev:$ARCH libxrandr2:$ARCH libxi-dev:$ARCH
  84. libgl1-mesa-dev:$ARCH libglu1-mesa-dev:$ARCH;
  85. if [ "$OPENAL" == "ON" ]; then sudo apt-get install -y libopenal-dev; fi;
  86. if [ "$ARCH" == "i386" ]; then export CMAKE_ARCH_ARGS='-DCMAKE_C_FLAGS=-m32 -DCMAKE_SYSTEM_LIBRARY_PATH=/usr/lib/i386-linux-gnu -DSUPPORT_FILEFORMAT_FLAC=OFF'; fi;
  87. export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH";
  88. if [ "$INSTALL_GLFW" == "YES" ]; then
  89. wget 'http://ftp.de.debian.org/debian/pool/main/g/glfw3/libglfw3_3.2.1-1_amd64.deb';
  90. wget 'http://ftp.de.debian.org/debian/pool/main/g/glfw3/libglfw3-dev_3.2.1-1_amd64.deb';
  91. sudo dpkg -i libglfw3_3.2.1-1_amd64.deb libglfw3-dev_3.2.1-1_amd64.deb;
  92. fi;
  93. fi;
  94. fi
  95. - if [ "$TRAVIS_OS_NAME" == "osx" ]; then
  96. export RAYLIB_PACKAGE_SUFFIX="-macOS";
  97. if [ "$INSTALL_GLFW" == "YES" ]; then brew update; brew install glfw; fi;
  98. fi
  99. - if [ "$TRAVIS_OS_NAME" == "windows" ]; then
  100. export DONT_TEST=1;
  101. export RAYLIB_PACKAGE_SUFFIX="-windows";
  102. export CMAKE_ARCH_ARGS='-DPLATFORM=Desktop';
  103. fi
  104. - mkdir build
  105. - $RUNNER $CC --version
  106. script:
  107. - cd build
  108. - if test -n "$WAYLAND";
  109. then wget https://mirrors.kernel.org/ubuntu/pool/universe/e/extra-cmake-modules/extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb;
  110. sudo dpkg -i extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb;
  111. git clone git://anongit.freedesktop.org/wayland/wayland-protocols;
  112. pushd wayland-protocols;
  113. git checkout 1.15 && ./autogen.sh --prefix=/usr && make && sudo make install;
  114. popd;
  115. fi
  116. - $RUNNER cmake $CMAKE_ARCH_ARGS
  117. -DMACOS_FATLIB=ON
  118. -DSTATIC=$STATIC -DSHARED=$SHARED
  119. -DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON
  120. -DUSE_EXTERNAL_GLFW=$USE_EXTERNAL_GLFW
  121. -DUSE_WAYLAND=$WAYLAND
  122. -DINCLUDE_EVERYTHING=ON
  123. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
  124. ..
  125. - $RUNNER cmake --build . --target
  126. - if [ "$RELEASE" != "NO" ]; then $RUNNER cmake --build . --target package; fi
  127. - if [ -n "$RUNNER" ]; then
  128. sudo $RUNNER cmake --build . --target install;
  129. else
  130. $(which sudo) $RUNNER "$(which cmake)" --build . --target install;
  131. fi
  132. - if [ ! "$DONT_TEST" ]; then
  133. pkg-config --static --libs raylib;
  134. nm -g release/libraylib.a | grep glfwGetProcAddress || (echo "libraylib.a doesn't contain GLFW symbols! Aborting..." && false);
  135. ctest --output-on-failure;
  136. fi
  137. deploy:
  138. provider: releases
  139. api_key:
  140. secure: LvqUIAN/3dJul+Ra2iK3tSaNG5IwsNMmGIwVMy0DK5IBCxiQPBc9pWGiE30RTBPt6Z+N4BhMEE8DtUl+vnISlMoHWNIIhF2zwC66hs/F7zY7qEITMRSmfiLcqxQysknFOnJB06CATgXcFqlEo9j+t4abrG/f3qcb92J4O2uNz336Au2myTx93Q5MxbyA7KiUuEutFnb2dWiPCY4d+sGeXEfsiD2R7aj/8MaWOkoGdZVrTkI9juMgvpImkjQBArvqdjUMeT3MsRrwgOIq5v2GFV9dOl8k1WzPeT8B2JHh00ed/o1/wuFq/cLLOxtYo2+Pv3+xatOrlexoX0WkDm7C9/L1W5U4rLexU3CQ9mMBmHPnp6k/WXZ5QXEE4uUF0+LpN3XlIXzFpdZmZiVV8VLxg2WvyncMmivYiu7/MTkyfZxyKkzwl7sZZslzHA9kOGedGaN7b7/2B77OFHoQK8lKfdFml7jJnarh+89nenNZYMab0E8qkOJOyb2bYlDTa0/2nyxGiyymYgq6YHLNrDbhqB/1LzdgzjMliQ8ri5q9Ux2vjfcqOzhfAmcwFwnY/D6yXJWYi0DWpHZdpKl3du6dYDrypW91/yDWbwiJ/YhrE7ZunzrcB6GH/QkbuzWxdCth39rQAHih8DG01co/K3Gvi4yGjvIH5tFUpyEolMnpMiA=
  141. file_glob: true
  142. file: raylib-*.tar.gz
  143. skip_cleanup: true
  144. on:
  145. repo: raysan5/raylib
  146. branch: master
  147. tags: true