Skip to content

Commit

Permalink
- Added readme to msvc patches
Browse files Browse the repository at this point in the history
- Fixed build scripts to correctly determine the path of PSMoveAPI's root dir (works for both local and TravisCI build)
- Fixed AppVeyor config for new path
- Added mingw cross compile build to travis
- Added osx build to travis
  • Loading branch information
rovarma committed Feb 24, 2016
1 parent 4de3218 commit fc10baa
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 13 deletions.
29 changes: 21 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
sudo: required

dist: trusty

language:
- cpp

matrix:
include:
- os: linux
dist: trusty
sudo: required
env: TYPE=debian
- os: linux
dist: trusty
sudo: required
env: TYPE=cross
- os: osx
env: TYPE=osx

before_install:
- sudo add-apt-repository --yes ppa:zoogie/sdl2-snapshots
- sudo add-apt-repository --yes ppa:kubuntu-ppa/backports
- sudo add-apt-repository --yes ppa:hlprasu/swig-trusty-backports
- if [[ "$TYPE" == "debian" ]]; then sudo add-apt-repository --yes ppa:zoogie/sdl2-snapshots; fi
- if [[ "$TYPE" == "debian" ]]; then sudo add-apt-repository --yes ppa:kubuntu-ppa/backports; fi
- if [[ "$TYPE" == "debian" ]]; then sudo add-apt-repository --yes ppa:hlprasu/swig-trusty-backports; fi
- if [[ "$TYPE" == "debian" ]]; then sudo apt-get update -qq; fi
- if [[ "$TYPE" == "cross" ]]; then sudo apt-get install -q -y mingw-w64 g++-mingw-w64; fi

install:
- git submodule update --init --recursive

script:
- ./build_scripts/ubuntu/build.sh
- if [[ "$TYPE" == "debian" ]]; then ./contrib/build_scripts/debian/build.sh; fi
- if [[ "$TYPE" == "cross" ]]; then ./contrib/build_scripts/debian/cross-compile-mingw64; fi
- if [[ "$TYPE" == "osx" ]]; then ./contrib/build_scripts/osx/build-osx-snapshot; fi
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ install:

build_script:
- cmd: >-
call build_scripts/msvc/build_msvc_2015.bat
call contrib/build_scripts/msvc/build_msvc_2015.bat
test: off
2 changes: 1 addition & 1 deletion contrib/build_scripts/debian/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [[ -v $TRAVIS_BUILD_DIR ]]
then
PSMOVE_API_ROOT_DIR=$TRAVIS_BUILD_DIR
else
PSMOVE_API_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../../"
PSMOVE_API_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../../../"
fi

cd $PSMOVE_API_ROOT_DIR
Expand Down
8 changes: 7 additions & 1 deletion contrib/build_scripts/debian/cross-compile-mingw64
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
# sudo apt-get install mingw-w64 g++-mingw-w64
#

export PSMOVEAPI_CHECKOUT=$(pwd)
# Determine PSMoveAPI root dir
if [[ -v $TRAVIS_BUILD_DIR ]]
then
export PSMOVEAPI_CHECKOUT=$TRAVIS_BUILD_DIR
else
export PSMOVEAPI_CHECKOUT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../../../"
fi

if [ ! -f $PSMOVEAPI_CHECKOUT/CMakeLists.txt ]; then
echo "ERROR: You have to run this script in the PS Move API source root."
Expand Down
2 changes: 1 addition & 1 deletion contrib/build_scripts/msvc/build_msvc_common.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ IF "%MSVC_VERSION%" NEQ "2015" (
)
)

set PSMOVE_API_ROOT_DIR=%~dp0..\..\
set PSMOVE_API_ROOT_DIR=%~dp0..\..\..\
set PSMOVE_API_EXTERNAL_DIR=%PSMOVE_API_ROOT_DIR%\external
set LIBUSB_DIR=%PSMOVE_API_EXTERNAL_DIR%\libusb-1.0
set SDL2_DIR=%PSMOVE_API_EXTERNAL_DIR%\SDL2
Expand Down
9 changes: 8 additions & 1 deletion contrib/build_scripts/osx/build-osx-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
# Thomas Perl <m@thp.io>; 2012-09-28
#

export PSMOVEAPI_CHECKOUT=$(pwd)
# Determine PSMoveAPI root dir
if [[ -v $TRAVIS_BUILD_DIR ]]
then
export PSMOVEAPI_CHECKOUT=$TRAVIS_BUILD_DIR
else
export PSMOVEAPI_CHECKOUT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../../../"
fi

export OPENCV_CHECKOUT_DIR=$PSMOVEAPI_CHECKOUT/external/opencv
export OPENCV_INSTALL_DIR=$OPENCV_CHECKOUT_DIR/build/install

Expand Down
12 changes: 12 additions & 0 deletions contrib/msvc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This directory contains some patches that are needed to build PSMoveAPI for Windows using Visual Studio:

#### libusb_dynamic_crt.patch
The libusb project links against the static CRT by default. PSMoveAPI links against the dynamic CRT.
Mixing these two together in the same program usually leads to problems, so this patch patches libusb to also link against the dynamic CRT.

#### sdl_vs2015_libs
The version of SDL2 that we're using does not currently work with VS2015.
There is a newer version of SDL2 available that does, but the way they've chosen to fix the VS2015 issues (/NODEFAULTLIB and other shenanigans)
usually leads to more problems down the line.

This patch fixes SDL2 in the correct way for VS2015 (ie. just adding some extra libs to link against). Once SDL2 mainline has been properly fixed, we can remove this patch.

0 comments on commit fc10baa

Please sign in to comment.