Travis CI: Add OpenAL-Configuration
This commit is contained in:
parent
cf021e3811
commit
69e147417b
46
.travis.yml
46
.travis.yml
@ -17,10 +17,10 @@ matrix:
|
|||||||
env: ARCH=amd64 INSTALL_GLFW=YES USE_EXTERNAL_GLFW=OFF
|
env: ARCH=amd64 INSTALL_GLFW=YES USE_EXTERNAL_GLFW=OFF
|
||||||
sudo: required
|
sudo: required
|
||||||
- os: linux
|
- os: linux
|
||||||
env: ARCH=amd64 INSTALL_GLFW=YES RELEASE=NO
|
env: ARCH=amd64 INSTALL_GLFW=YES OPENAL=ON RELEASE=NO
|
||||||
sudo: required
|
sudo: required
|
||||||
- os: linux
|
- os: linux
|
||||||
env: USE_WAYLAND=ON ARCH=amd64 RELEASE=NO
|
env: WAYLAND=ON ARCH=amd64 RELEASE=NO
|
||||||
sudo: required
|
sudo: required
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@ -46,12 +46,9 @@ matrix:
|
|||||||
before_script:
|
before_script:
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- if [ -z "$USE_EXTERNAL_GLFW" ]; then
|
- if [ -z "$USE_EXTERNAL_GLFW" ]; then USE_EXTERNAL_GLFW=IF_POSSIBLE; fi
|
||||||
export USE_EXTERNAL_GLFW=IF_POSSIBLE;
|
- if [ -z "$SHARED" ]; then SHARED=ON ; fi
|
||||||
fi
|
- if [ -z "$OPENAL" ]; then OPENAL=OFF ; fi
|
||||||
- if [ -z "$SHARED" ]; then
|
|
||||||
export SHARED=ON;
|
|
||||||
fi
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
||||||
if [[ "$ARCH" == *-android ]]; then
|
if [[ "$ARCH" == *-android ]]; then
|
||||||
export RAYLIB_PACKAGE_SUFFIX="-Android-arm64";
|
export RAYLIB_PACKAGE_SUFFIX="-Android-arm64";
|
||||||
@ -59,32 +56,32 @@ before_install:
|
|||||||
unzip -qq android-ndk*.zip;
|
unzip -qq android-ndk*.zip;
|
||||||
if [[ "$ARCH" == arm64-* ]]; then
|
if [[ "$ARCH" == arm64-* ]]; then
|
||||||
export RAYLIB_PACKAGE_SUFFIX="-Android-arm64";
|
export RAYLIB_PACKAGE_SUFFIX="-Android-arm64";
|
||||||
export TOOLCHAIN_ARCH=arm64;
|
TOOLCHAIN_ARCH=arm64;
|
||||||
export PREFIX=aarch64-linux-android-;
|
PREFIX=aarch64-linux-android-;
|
||||||
else
|
else
|
||||||
export RAYLIB_PACKAGE_SUFFIX="-Android-arm32";
|
export RAYLIB_PACKAGE_SUFFIX="-Android-arm32";
|
||||||
export TOOLCHAIN_ARCH=arm;
|
TOOLCHAIN_ARCH=arm;
|
||||||
export PREFIX=arm-linux-androideabi-;
|
PREFIX=arm-linux-androideabi-;
|
||||||
fi;
|
fi;
|
||||||
android-ndk*/build/tools/make_standalone_toolchain.py --arch $TOOLCHAIN_ARCH --api 21 --install-dir /tmp/android-toolchain;
|
android-ndk*/build/tools/make_standalone_toolchain.py --arch $TOOLCHAIN_ARCH --api 21 --install-dir /tmp/android-toolchain;
|
||||||
export PATH=/tmp/android-toolchain/bin:$PATH;
|
export PATH=/tmp/android-toolchain/bin:$PATH;
|
||||||
export CC=${PREFIX}clang;
|
export CC=${PREFIX}clang;
|
||||||
export CXX=${PREFIX}clang++;
|
export CXX=${PREFIX}clang++;
|
||||||
export CMAKE_ARCH_ARGS='-DPLATFORM=Android';
|
CMAKE_ARCH_ARGS='-DPLATFORM=Android';
|
||||||
elif [ "$ARCH" == "html5" ]; then
|
elif [ "$ARCH" == "html5" ]; then
|
||||||
export RAYLIB_PACKAGE_SUFFIX="-html5";
|
export RAYLIB_PACKAGE_SUFFIX="-html5";
|
||||||
docker run --privileged=true -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash;
|
docker run --privileged=true -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash;
|
||||||
export CMAKE_ARCH_ARGS='-DPLATFORM=Web -DCMAKE_TOOLCHAIN_FILE=../cmake/emscripten.cmake';
|
CMAKE_ARCH_ARGS='-DPLATFORM=Web -DCMAKE_TOOLCHAIN_FILE=../cmake/emscripten.cmake';
|
||||||
export RUNNER='docker exec -it emscripten cmake -E chdir build';
|
RUNNER='docker exec -it emscripten cmake -E chdir build';
|
||||||
else
|
else
|
||||||
sudo apt-get install -y gcc-multilib
|
sudo apt-get install -y gcc-multilib
|
||||||
libasound2-dev:$ARCH
|
libasound2-dev:$ARCH
|
||||||
libxcursor-dev:$ARCH libxinerama-dev:$ARCH mesa-common-dev:$ARCH
|
libxcursor-dev:$ARCH libxinerama-dev:$ARCH mesa-common-dev:$ARCH
|
||||||
libx11-dev:$ARCH libxrandr-dev:$ARCH libxrandr2:$ARCH libxi-dev:$ARCH
|
libx11-dev:$ARCH libxrandr-dev:$ARCH libxrandr2:$ARCH libxi-dev:$ARCH
|
||||||
libgl1-mesa-dev:$ARCH libglu1-mesa-dev:$ARCH;
|
libgl1-mesa-dev:$ARCH libglu1-mesa-dev:$ARCH;
|
||||||
if [ "$ARCH" == "i386" ]; then
|
|
||||||
export CMAKE_ARCH_ARGS='-DCMAKE_C_FLAGS=-m32 -DCMAKE_SYSTEM_LIBRARY_PATH=/usr/lib/i386-linux-gnu';
|
if [ "$OPENAL" == "ON" ]; then sudo apt-get install -y libopenal-dev; fi;
|
||||||
fi;
|
if [ "$ARCH" == "i386" ]; then CMAKE_ARCH_ARGS='-DCMAKE_C_FLAGS=-m32 -DCMAKE_SYSTEM_LIBRARY_PATH=/usr/lib/i386-linux-gnu'; fi;
|
||||||
export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH";
|
export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH";
|
||||||
if [ "$INSTALL_GLFW" == "YES" ]; then
|
if [ "$INSTALL_GLFW" == "YES" ]; then
|
||||||
wget 'http://ftp.de.debian.org/debian/pool/main/g/glfw3/libglfw3_3.2.1-1_amd64.deb';
|
wget 'http://ftp.de.debian.org/debian/pool/main/g/glfw3/libglfw3_3.2.1-1_amd64.deb';
|
||||||
@ -102,7 +99,7 @@ before_install:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- cd build
|
- cd build
|
||||||
- if test -n "${USE_WAYLAND}";
|
- if test -n "$WAYLAND";
|
||||||
then wget https://mirrors.kernel.org/ubuntu/pool/universe/e/extra-cmake-modules/extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb;
|
then wget https://mirrors.kernel.org/ubuntu/pool/universe/e/extra-cmake-modules/extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb;
|
||||||
sudo dpkg -i extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb;
|
sudo dpkg -i extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb;
|
||||||
git clone git://anongit.freedesktop.org/wayland/wayland-protocols;
|
git clone git://anongit.freedesktop.org/wayland/wayland-protocols;
|
||||||
@ -110,9 +107,16 @@ script:
|
|||||||
git checkout 1.12 && ./autogen.sh --prefix=/usr && make && sudo make install;
|
git checkout 1.12 && ./autogen.sh --prefix=/usr && make && sudo make install;
|
||||||
popd;
|
popd;
|
||||||
fi
|
fi
|
||||||
- $RUNNER cmake $CMAKE_ARCH_ARGS -DMACOS_FATLIB=ON -DSTATIC=ON -DSHARED=$SHARED -DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON -DUSE_EXTERNAL_GLFW=$USE_EXTERNAL_GLFW -DUSE_WAYLAND=${USE_WAYLAND} ..
|
- $RUNNER cmake $CMAKE_ARCH_ARGS
|
||||||
|
-DMACOS_FATLIB=ON
|
||||||
|
-DSTATIC=ON -DSHARED=$SHARED
|
||||||
|
-DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON
|
||||||
|
-DUSE_EXTERNAL_GLFW=$USE_EXTERNAL_GLFW
|
||||||
|
-DUSE_WAYLAND=$WAYLAND
|
||||||
|
-DUSE_OPENAL_BACKEND=$OPENAL
|
||||||
|
..
|
||||||
- $RUNNER make VERBOSE=1
|
- $RUNNER make VERBOSE=1
|
||||||
- if [ "$RELEASE" != "NO" ]; then $RUNNER make package; fi;
|
- if [ "$RELEASE" != "NO" ]; then $RUNNER make package; fi
|
||||||
- sudo $RUNNER make install
|
- sudo $RUNNER make install
|
||||||
- if [[ "$ARCH" != *-android && "$ARCH" != html5 ]]; then
|
- if [[ "$ARCH" != *-android && "$ARCH" != html5 ]]; then
|
||||||
pkg-config --static --libs raylib;
|
pkg-config --static --libs raylib;
|
||||||
|
@ -3,8 +3,10 @@ cmake_minimum_required(VERSION 2.8.0)
|
|||||||
|
|
||||||
add_definitions("-DRAYLIB_CMAKE=1")
|
add_definitions("-DRAYLIB_CMAKE=1")
|
||||||
|
|
||||||
# Linking for OS X -framework options
|
if (${USE_OPENAL_BACKEND})
|
||||||
# Will do nothing on other OSes
|
find_package(OpenAL REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${PLATFORM} MATCHES "Android")
|
if(${PLATFORM} MATCHES "Android")
|
||||||
find_library(OPENGL_LIBRARY OpenGL)
|
find_library(OPENGL_LIBRARY OpenGL)
|
||||||
set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c)
|
set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c)
|
||||||
@ -22,8 +24,6 @@ else()
|
|||||||
set(OPENGL_LIBRARIES "GL")
|
set(OPENGL_LIBRARIES "GL")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
|
||||||
|
|
||||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
|
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
|
||||||
find_library(OSS_LIBRARY ossaudio)
|
find_library(OSS_LIBRARY ossaudio)
|
||||||
endif()
|
endif()
|
||||||
@ -31,6 +31,9 @@ else()
|
|||||||
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
|
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include_directories(${OPENGL_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR})
|
||||||
|
set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY})
|
||||||
|
|
||||||
if(${PLATFORM} MATCHES "Desktop")
|
if(${PLATFORM} MATCHES "Desktop")
|
||||||
if(USE_EXTERNAL_GLFW STREQUAL "ON")
|
if(USE_EXTERNAL_GLFW STREQUAL "ON")
|
||||||
find_package(glfw3 3.2.1 REQUIRED)
|
find_package(glfw3 3.2.1 REQUIRED)
|
||||||
|
@ -40,10 +40,16 @@ endif()
|
|||||||
include(utils)
|
include(utils)
|
||||||
|
|
||||||
if(USE_AUDIO)
|
if(USE_AUDIO)
|
||||||
|
if (NOT USE_OPENAL_BACKEND)
|
||||||
|
file(GLOB mini_al external/mini_al.c)
|
||||||
|
MESSAGE(STATUS "Audio Backend: mini_al")
|
||||||
|
else()
|
||||||
|
MESSAGE(STATUS "Audio Backend: OpenAL")
|
||||||
|
endif()
|
||||||
file(GLOB stb_vorbis external/stb_vorbis.c)
|
file(GLOB stb_vorbis external/stb_vorbis.c)
|
||||||
file(GLOB mini_al external/mini_al.c ${stb_vorbis})
|
set(sources ${raylib_sources} ${mini_al} ${stb_vorbis})
|
||||||
set(sources ${raylib_sources} ${mini_al})
|
|
||||||
else()
|
else()
|
||||||
|
MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)")
|
||||||
set(INCLUDE_AUDIO_MODULE 0)
|
set(INCLUDE_AUDIO_MODULE 0)
|
||||||
list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio.c)
|
list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio.c)
|
||||||
set(sources ${raylib_sources})
|
set(sources ${raylib_sources})
|
||||||
|
Loading…
Reference in New Issue
Block a user