Browse Source

For Travis CI - workaround FindALSA cmake module bug on Ubuntu 12.04.

Yao Wei Tjong 姚伟忠 11 years ago
parent
commit
ed1f820f9b
2 changed files with 8 additions and 1 deletions
  1. 1 1
      .travis.yml
  2. 7 0
      Source/ThirdParty/SDL/CMakeLists.txt

+ 1 - 1
.travis.yml

@@ -50,7 +50,7 @@ before_install:
     - bash -c "[ $ON_MASTER_COMMIT ]" && export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT) && echo $COMMIT_MESSAGE |grep -cq '\[ci package\]' && git fetch --depth=2000 --tags origin $TRAVIS_BRANCH && export PACKAGE_UPLOAD=1 || true
     - bash -c "[ $ON_MASTER_COMMIT ]" && export RELEASE_TAG=$(git describe --tags --exact-match $TRAVIS_COMMIT 2>/dev/null) && bash -c "[ $RELEASE_TAG ]" && export PACKAGE_UPLOAD=1 || true
     - bash -c "[ $ANDROID ]" && wget -q http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86_64.tar.bz2 && tar xjf *.bz2 && rm *.bz2 && ln -s android-ndk* android-ndk && export ANDROID_NDK=$(pwd)/android-ndk && bash -c "[ $PACKAGE_UPLOAD ]" && wget -q http://dl.google.com/android/android-sdk_r22.6.1-linux.tgz && tar xzf *.tgz && rm *.tgz && ln -s android-sdk* android-sdk && export ANDROID_SDK=$(pwd)/android-sdk || true
-    - bash -c "[ $RPI ]" && git clone --depth 1 https://github.com/raspberrypi/tools.git rpi-tools && export RASPI_TOOL=$(pwd)/rpi-tools && git clone --depth=1 https://github.com/urho3d/rpi-sysroot.git rpi-sysroot && export RASPI_ROOT=$(pwd)/rpi-sysroot || true
+    - bash -c "[ $RPI ]" && git clone --depth 1 https://github.com/raspberrypi/tools.git rpi-tools && export RASPI_TOOL=$(pwd)/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin && git clone --depth=1 https://github.com/urho3d/rpi-sysroot.git rpi-sysroot && export RASPI_ROOT=$(pwd)/rpi-sysroot || true
     - bash -c "( [ $SITE_UPDATE_ON_MASTER_COMMIT ] || [ $PACKAGE_UPLOAD ] )" && sudo add-apt-repository ppa:george-edison55/precise-backports -y || true
     - sudo apt-get update -q -y
 install:

+ 7 - 0
Source/ThirdParty/SDL/CMakeLists.txt

@@ -90,6 +90,13 @@ else ()
         file (GLOB VIDEO_DRIVER_C_FILES src/video/x11/*.c)
     endif ()
     find_package (ALSA REQUIRED)
+    # todo: remove this fix when the minimum CMake version has been raised to higher than 2.8.7
+    # There is a bug in older version of FindALSA.cmake module where it erroneously include 'alsa' directory component into the variable
+    # For cross-compiling build to work correctly, this extra directory component must be removed
+    if (ALSA_INCLUDE_DIRS MATCHES .*/alsa)
+        get_filename_component (ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIRS} PATH)
+    endif ()
+    # end todo
     include_directories (${ALSA_INCLUDE_DIRS})
 
     file (GLOB SYS_C_FILES