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.

165 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-r21-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. export PATH=/android-ndk*/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH;
  69. export CC=${PREFIX}clang;
  70. export CXX=${PREFIX}clang++;
  71. export CMAKE_ARCH_ARGS='-DPLATFORM=Android';
  72. elif [ "$ARCH" == "html5" ]; then
  73. export DONT_TEST=1;
  74. export RAYLIB_PACKAGE_SUFFIX="-html5";
  75. docker run --privileged=true -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-latest bash;
  76. export CMAKE_ARCH_ARGS='-DPLATFORM=Web -DCMAKE_TOOLCHAIN_FILE=../cmake/emscripten.cmake';
  77. RUNNER='docker exec -it emscripten cmake -E chdir build';
  78. else
  79. sudo apt-get install -y gcc-multilib
  80. libasound2-dev:$ARCH
  81. libxcursor-dev:$ARCH libxinerama-dev:$ARCH mesa-common-dev:$ARCH
  82. libx11-dev:$ARCH libxrandr-dev:$ARCH libxrandr2:$ARCH libxi-dev:$ARCH
  83. libgl1-mesa-dev:$ARCH libglu1-mesa-dev:$ARCH;
  84. if [ "$OPENAL" == "ON" ]; then sudo apt-get install -y libopenal-dev; fi;
  85. 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;
  86. export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH";
  87. if [ "$INSTALL_GLFW" == "YES" ]; then
  88. pushd src/external/glfw;
  89. cmake . -DGLFW_BUILD_DOCS=OFF
  90. -DGLFW_BUILD_TESTS=OFF
  91. -DGLFW_BUILD_EXAMPLES=OFF
  92. -DGLFW_INSTALL=ON
  93. -DBUILD_SHARED_LIBS=ON
  94. -DGLFW_USE_WAYLAND=$WAYLAND;
  95. make;
  96. sudo make install;
  97. popd;
  98. fi;
  99. fi;
  100. fi
  101. - if [ "$TRAVIS_OS_NAME" == "osx" ]; then
  102. export RAYLIB_PACKAGE_SUFFIX="-macOS";
  103. if [ "$INSTALL_GLFW" == "YES" ]; then brew update; brew install glfw; fi;
  104. fi
  105. - if [ "$TRAVIS_OS_NAME" == "windows" ]; then
  106. export DONT_TEST=1;
  107. export RAYLIB_PACKAGE_SUFFIX="-windows";
  108. export CMAKE_ARCH_ARGS='-DPLATFORM=Desktop';
  109. fi
  110. - mkdir build
  111. - $RUNNER $CC --version
  112. script:
  113. - cd build
  114. - if test -n "$WAYLAND"; then
  115. wget https://mirrors.edge.kernel.org/ubuntu/pool/universe/e/extra-cmake-modules/extra-cmake-modules_5.44.0-0ubuntu1_amd64.deb;
  116. sudo apt-get clean;
  117. sudo apt-get update;
  118. sudo apt-get install dpkg;
  119. sudo dpkg -i extra-cmake-modules_5.44.0-0ubuntu1_amd64.deb;
  120. git clone git://anongit.freedesktop.org/wayland/wayland-protocols;
  121. pushd wayland-protocols;
  122. git checkout 1.15 && ./autogen.sh --prefix=/usr && make && sudo make install;
  123. popd;
  124. fi
  125. - $RUNNER cmake $CMAKE_ARCH_ARGS
  126. -DMACOS_FATLIB=ON
  127. -DSTATIC=$STATIC -DSHARED=$SHARED
  128. -DBUILD_EXAMPLES=ON
  129. -DUSE_EXTERNAL_GLFW=$USE_EXTERNAL_GLFW
  130. -DUSE_WAYLAND=$WAYLAND
  131. -DINCLUDE_EVERYTHING=ON
  132. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
  133. ..
  134. - $RUNNER cmake --build . --target
  135. - if [ "$RELEASE" != "NO" ]; then $RUNNER cmake --build . --target package; fi
  136. - if [ -n "$RUNNER" ]; then
  137. sudo $RUNNER cmake --build . --target install;
  138. else
  139. $(which sudo) $RUNNER "$(which cmake)" --build . --target install;
  140. fi
  141. - if [ ! "$DONT_TEST" ]; then
  142. pkg-config --static --libs raylib;
  143. nm -g release/libraylib.a | grep glfwGetProcAddress || (echo "libraylib.a doesn't contain GLFW symbols! Aborting..." && false);
  144. ctest --output-on-failure;
  145. fi
  146. deploy:
  147. provider: releases
  148. api_key:
  149. 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=
  150. file_glob: true
  151. file: raylib-*.tar.gz
  152. skip_cleanup: true
  153. on:
  154. repo: raysan5/raylib
  155. branch: master
  156. tags: true