2018-06-25 20:28:41 +00:00
|
|
|
language: cpp
|
2018-06-27 01:55:19 +00:00
|
|
|
services:
|
|
|
|
- docker
|
2018-06-26 02:26:48 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: linux
|
|
|
|
compiler: gcc
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=linux
|
|
|
|
TRAVIS_COMPILER_NAME=gcc
|
|
|
|
TRAVIS_BUILD_SYSTEM=autotools
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
- os: osx
|
|
|
|
compiler: clang
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=osx
|
|
|
|
TRAVIS_COMPILER_NAME=clang
|
|
|
|
TRAVIS_BUILD_SYSTEM=autotools
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
- os: linux
|
|
|
|
compiler: gcc
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=linux
|
|
|
|
TRAVIS_COMPILER_NAME=gcc
|
|
|
|
TRAVIS_BUILD_SYSTEM=Makefile
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
- os: linux
|
|
|
|
compiler: clang
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=linux
|
|
|
|
TRAVIS_COMPILER_NAME=clang
|
|
|
|
TRAVIS_BUILD_SYSTEM=Makefile
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
2020-04-03 19:11:12 +00:00
|
|
|
- os: linux
|
|
|
|
dist: bionic
|
2018-06-26 02:26:48 +00:00
|
|
|
compiler: gcc
|
|
|
|
env: >-
|
2020-04-03 19:11:12 +00:00
|
|
|
TRAVIS_OS_NAME=linux
|
2018-06-26 02:26:48 +00:00
|
|
|
TRAVIS_COMPILER_NAME=gcc
|
|
|
|
TRAVIS_BUILD_SYSTEM=Makefile
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
HYPERROGUE_USE_ROGUEVIZ=1
|
2020-04-03 19:11:12 +00:00
|
|
|
- os: linux
|
|
|
|
compiler: clang
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=linux
|
|
|
|
TRAVIS_COMPILER_NAME=clang
|
|
|
|
TRAVIS_BUILD_SYSTEM=Makefile
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
HYPERROGUE_USE_ROGUEVIZ=1
|
2018-06-26 02:26:48 +00:00
|
|
|
- os: osx
|
|
|
|
compiler: clang
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=osx
|
|
|
|
TRAVIS_COMPILER_NAME=clang
|
|
|
|
TRAVIS_BUILD_SYSTEM=Makefile
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
2020-04-03 19:11:12 +00:00
|
|
|
- os: osx
|
|
|
|
compiler: gcc
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=osx
|
|
|
|
TRAVIS_COMPILER_NAME=gcc
|
|
|
|
TRAVIS_BUILD_SYSTEM=Makefile
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
2018-06-26 02:26:48 +00:00
|
|
|
HYPERROGUE_USE_ROGUEVIZ=1
|
|
|
|
- os: osx
|
|
|
|
compiler: clang
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=osx
|
|
|
|
TRAVIS_COMPILER_NAME=clang
|
|
|
|
TRAVIS_BUILD_SYSTEM=Makefile
|
2020-04-03 19:11:12 +00:00
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
HYPERROGUE_USE_ROGUEVIZ=1
|
2018-06-27 01:55:19 +00:00
|
|
|
- os: linux
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=linux
|
|
|
|
TRAVIS_COMPILER_NAME=emscripten
|
|
|
|
TRAVIS_BUILD_SYSTEM=emscripten
|
Make "mymake" work on OSX, and add it to Travis.
Fix a -Wformat bug exposed by compiling with Clang.
To preprocess C++11 code, you need `g++ -E -std=c++11`, not just
`g++ -E`. (The old code worked for GCC 6+ and Clang 6+ because they
changed the default mode from C++03 to C++14. But for GCC 5, we still
need `-std=c++11`. And regardless, it's a good idea.)
Add a "-mac" option to mymake, and cleanly factor out `set_mac`,
`set_linux`, and `set_win`. When you build mymake using
`make -f Makefile.simple mymake`, you get a mymake that knows what
platform it's on. This means you don't have to pass `mymake -mac`
on OSX, nor `mymake -win` on Windows.
The old code put `INCLUDE(___hyper-main.cpp)` into a C++ file that
would be preprocessed, which doesn't work because libSDL does
essentially `-Dmain=SDL_main`, which turns this into
`INCLUDE(___hyper-SDL_main.cpp)`, which gives us
a "file not found" error from mymake. The solution is to put
filenames into quotation marks, so that the string "main" never
appears as a token in the C++ file. (Alternatively, we could have
renamed "hyper-main.cpp" to "hypermain.cpp".)
Add several new "mymake" entries in the Travis build matrix,
and add the "mymake" builds' badge to the README.
2020-04-04 02:01:26 +00:00
|
|
|
- os: osx
|
|
|
|
compiler: clang
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=osx
|
|
|
|
TRAVIS_COMPILER_NAME=clang
|
|
|
|
TRAVIS_BUILD_SYSTEM=mymake
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
- os: osx
|
|
|
|
compiler: clang
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=osx
|
|
|
|
TRAVIS_COMPILER_NAME=clang
|
|
|
|
TRAVIS_BUILD_SYSTEM=mymake
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
HYPERROGUE_USE_ROGUEVIZ=1
|
|
|
|
- os: linux
|
|
|
|
compiler: gcc
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=linux
|
|
|
|
TRAVIS_COMPILER_NAME=gcc
|
|
|
|
TRAVIS_BUILD_SYSTEM=mymake
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
- os: linux
|
|
|
|
dist: bionic
|
|
|
|
compiler: gcc
|
|
|
|
env: >-
|
|
|
|
TRAVIS_OS_NAME=linux
|
|
|
|
TRAVIS_COMPILER_NAME=gcc
|
|
|
|
TRAVIS_BUILD_SYSTEM=mymake
|
|
|
|
HYPERROGUE_USE_GLEW=1
|
|
|
|
HYPERROGUE_USE_PNG=1
|
|
|
|
HYPERROGUE_USE_ROGUEVIZ=1
|
2018-06-26 02:26:48 +00:00
|
|
|
|
2018-07-01 00:57:28 +00:00
|
|
|
before_install:
|
2018-06-26 02:26:48 +00:00
|
|
|
- |-
|
|
|
|
# Install SDL
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
|
|
sudo apt-get update -qq
|
|
|
|
sudo apt-get install -qq libsdl1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev
|
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
brew update
|
|
|
|
brew install sdl sdl_gfx sdl_mixer sdl_ttf
|
|
|
|
# work around https://stackoverflow.com/questions/51034399/ for now
|
|
|
|
(cd /usr/local/include && ln -sf SDL/SDL.h)
|
|
|
|
else
|
|
|
|
exit 'Unsupported OS'
|
|
|
|
fi
|
|
|
|
- |-
|
|
|
|
# Install GLEW if asked for
|
|
|
|
if [[ "$HYPERROGUE_USE_GLEW" == "1" ]]; then
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
|
|
sudo apt-get install -qq libglew-dev
|
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
brew install glew
|
|
|
|
else
|
|
|
|
exit 'Unsupported OS'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
- |-
|
|
|
|
# Install libpng if asked for
|
|
|
|
if [[ "$HYPERROGUE_USE_PNG" == "1" ]]; then
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
|
|
echo 'libpng is installed by default'
|
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
brew install libpng
|
|
|
|
else
|
|
|
|
exit 'Unsupported OS'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
- |-
|
|
|
|
# Install autotools if asked for
|
|
|
|
if [[ "$TRAVIS_USE_AUTOTOOLS" == "1" ]]; then
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
|
|
echo 'autotools is installed by default'
|
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
brew install automake
|
|
|
|
else
|
|
|
|
exit 'Unsupported OS'
|
2018-07-01 00:57:28 +00:00
|
|
|
fi
|
2018-06-26 02:26:48 +00:00
|
|
|
fi
|
|
|
|
|
2018-06-25 20:28:41 +00:00
|
|
|
script:
|
2018-07-01 00:57:28 +00:00
|
|
|
- |-
|
|
|
|
# Build hyperrogue.
|
2018-06-26 02:26:48 +00:00
|
|
|
if [[ "$TRAVIS_BUILD_SYSTEM" == "autotools" ]]; then
|
|
|
|
autoreconf -vi
|
2020-02-22 05:20:08 +00:00
|
|
|
./configure CXXFLAGS="-W -Wall -Wextra -Werror -Wno-unused-parameter -Wno-maybe-uninitialized -Wno-unknown-warning-option"
|
2018-06-26 02:26:48 +00:00
|
|
|
make
|
|
|
|
elif [[ "$TRAVIS_BUILD_SYSTEM" == "Makefile" ]]; then
|
2020-04-03 19:11:12 +00:00
|
|
|
make -f Makefile.simple
|
Make "mymake" work on OSX, and add it to Travis.
Fix a -Wformat bug exposed by compiling with Clang.
To preprocess C++11 code, you need `g++ -E -std=c++11`, not just
`g++ -E`. (The old code worked for GCC 6+ and Clang 6+ because they
changed the default mode from C++03 to C++14. But for GCC 5, we still
need `-std=c++11`. And regardless, it's a good idea.)
Add a "-mac" option to mymake, and cleanly factor out `set_mac`,
`set_linux`, and `set_win`. When you build mymake using
`make -f Makefile.simple mymake`, you get a mymake that knows what
platform it's on. This means you don't have to pass `mymake -mac`
on OSX, nor `mymake -win` on Windows.
The old code put `INCLUDE(___hyper-main.cpp)` into a C++ file that
would be preprocessed, which doesn't work because libSDL does
essentially `-Dmain=SDL_main`, which turns this into
`INCLUDE(___hyper-SDL_main.cpp)`, which gives us
a "file not found" error from mymake. The solution is to put
filenames into quotation marks, so that the string "main" never
appears as a token in the C++ file. (Alternatively, we could have
renamed "hyper-main.cpp" to "hypermain.cpp".)
Add several new "mymake" entries in the Travis build matrix,
and add the "mymake" builds' badge to the README.
2020-04-04 02:01:26 +00:00
|
|
|
elif [[ "$TRAVIS_BUILD_SYSTEM" == "mymake" ]]; then
|
|
|
|
make -f Makefile.simple mymake
|
|
|
|
if [[ "$HYPERROGUE_USE_ROGUEVIZ" == "1" ]]; then
|
|
|
|
./mymake -rv
|
|
|
|
else
|
|
|
|
./mymake
|
|
|
|
fi
|
2018-06-27 01:55:19 +00:00
|
|
|
elif [[ "$TRAVIS_BUILD_SYSTEM" == "emscripten" ]]; then
|
|
|
|
docker run --rm -v $(pwd):/src trzeci/emscripten make -f Makefile.simple emscripten
|
2018-06-26 02:26:48 +00:00
|
|
|
else
|
|
|
|
exit 'Unsupported build system'
|
|
|
|
fi
|
2018-07-01 00:57:28 +00:00
|
|
|
- |-
|
|
|
|
# Test hyperrogue.
|
2018-06-27 01:55:19 +00:00
|
|
|
if [[ "$TRAVIS_BUILD_SYSTEM" == "emscripten" ]]; then
|
|
|
|
ls -lAF hyper.html hyper.js hyper.wasm
|
Make "mymake" work on OSX, and add it to Travis.
Fix a -Wformat bug exposed by compiling with Clang.
To preprocess C++11 code, you need `g++ -E -std=c++11`, not just
`g++ -E`. (The old code worked for GCC 6+ and Clang 6+ because they
changed the default mode from C++03 to C++14. But for GCC 5, we still
need `-std=c++11`. And regardless, it's a good idea.)
Add a "-mac" option to mymake, and cleanly factor out `set_mac`,
`set_linux`, and `set_win`. When you build mymake using
`make -f Makefile.simple mymake`, you get a mymake that knows what
platform it's on. This means you don't have to pass `mymake -mac`
on OSX, nor `mymake -win` on Windows.
The old code put `INCLUDE(___hyper-main.cpp)` into a C++ file that
would be preprocessed, which doesn't work because libSDL does
essentially `-Dmain=SDL_main`, which turns this into
`INCLUDE(___hyper-SDL_main.cpp)`, which gives us
a "file not found" error from mymake. The solution is to put
filenames into quotation marks, so that the string "main" never
appears as a token in the C++ file. (Alternatively, we could have
renamed "hyper-main.cpp" to "hypermain.cpp".)
Add several new "mymake" entries in the Travis build matrix,
and add the "mymake" builds' badge to the README.
2020-04-04 02:01:26 +00:00
|
|
|
elif [[ "$TRAVIS_BUILD_SYSTEM" == "mymake" ]]; then
|
|
|
|
./hyper --help
|
2018-06-27 01:55:19 +00:00
|
|
|
else
|
|
|
|
./hyperrogue --help
|
|
|
|
fi
|
2018-07-01 00:57:28 +00:00
|
|
|
- |-
|
|
|
|
# Test "make dist". ("make distcheck" is expected to fail.)
|
2018-06-26 02:26:48 +00:00
|
|
|
if [[ "$TRAVIS_BUILD_SYSTEM" == "autotools" ]]; then make dist; fi
|
2018-07-01 00:57:28 +00:00
|
|
|
- |-
|
|
|
|
# Test "sudo make install".
|
2018-06-26 02:26:48 +00:00
|
|
|
if [[ "$TRAVIS_BUILD_SYSTEM" == "autotools" ]]; then sudo make install; fi
|