add Travis CI support

Use a matrix of 4 jobs, linux (ubuntu trusty), mingw i686, mingw x86-64
and mac.

Automatically detect ccache in the cmake config and cache the
`~/.ccache` directory for faster rebuilds.

Instructions for ccache in cmake are here:
https://stackoverflow.com/a/24305849

Change build status badge in README.md to Travis.
This commit is contained in:
Rafael Kitover 2018-06-26 19:15:22 -07:00
parent fde9d731a8
commit 8778837c83
3 changed files with 64 additions and 1 deletions

55
.travis.yml Normal file
View File

@ -0,0 +1,55 @@
---
sudo: required
cache:
directories:
- "$HOME/.ccache"
matrix:
fast_finish: true
include:
- env: BUILD_ENV=ubuntu
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps
script:
- mkdir build
- cd build
- cmake ..
- make -j2
# - ./visualboyadvance-m --help
- env: BUILD_ENV=mingw-w64
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps MinGW-w64-x86_64
script:
- mkdir build
- cd build
- /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake ..
- make -j2
- env: BUILD_ENV=mingw-w32
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps MinGW-w64-i686
script:
- mkdir build
- cd build
- /usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake ..
- make -j2
- env: BUILD_ENV=mac
language: cpp
os: osx
before_script:
- ./installdeps
script:
- mkdir build
- cd build
- cmake ..
- make -j2
# - ./visualboyadvance-m.app/Contents/MacOS/visualboyadvance-m --help

View File

@ -38,6 +38,13 @@ endif()
set(ASM_DEFAULT OFF) set(ASM_DEFAULT OFF)
# use ccache if available
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
if(NOT CMAKE_SYSTEM_PROCESSOR) if(NOT CMAKE_SYSTEM_PROCESSOR)
if(NOT CMAKE_TOOLCHAIN_FILE AND CMAKE_HOST_SYSTEM_PROCESSOR) if(NOT CMAKE_TOOLCHAIN_FILE AND CMAKE_HOST_SYSTEM_PROCESSOR)
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR}) set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})

View File

@ -15,7 +15,8 @@
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
[![Join the chat at https://gitter.im/visualboyadvance-m/Lobby](https://badges.gitter.im/visualboyadvance-m/Lobby.svg)](https://gitter.im/visualboyadvance-m/Lobby) [![Join the chat at https://gitter.im/visualboyadvance-m/Lobby](https://badges.gitter.im/visualboyadvance-m/Lobby.svg)](https://gitter.im/visualboyadvance-m/Lobby)
[![Build Status](https://tea-ci.org/api/badges/visualboyadvance-m/visualboyadvance-m/status.svg)](https://tea-ci.org/visualboyadvance-m/visualboyadvance-m) [![Build Status](https://travis-ci.org/visualboyadvance-m/visualboyadvance-m.svg?branch=master)](https://travis-ci.org/visualboyadvance-m/visualboyadvance-m)
# Visual Boy Advance - M # Visual Boy Advance - M
Game Boy Advance Emulator Game Boy Advance Emulator