From 5c4c07d81557fa47a3bfcc03b1e9e25c8dd8a433 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Thu, 31 Oct 2019 21:05:06 +0100 Subject: [PATCH 01/23] Started basic .travis.yml setup --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..759269dc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: cpp + +compiler: + - clang + - gcc + +dist: + - trusty From 555b2e4ad0298bec68f38e0044fe4668d785db52 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 12:53:48 +0100 Subject: [PATCH 02/23] Added some more .travis.yml support Signed-off-by: Gabriel Ravier --- .travis.yml | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 142 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 759269dc..ecca509a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,145 @@ +# Optimize git clone +git: + depth: 5 + +# No need for sudo +sudo: false + +# Use linux unless specified otherwise +os: linux + +# Bionic is the most recent version of Ubuntu I can get to work properly +dist: bionic + +# Enable C++ language support language: cpp -compiler: - - clang - - gcc +# Cache compiled object files with ccache +cache: ccache -dist: - - trusty +# Matrix for configuring all the build configurations +matrix: + include: + # Clang on OSX + - env: COMPILER=clang++ BUILD_TYPE=Debug + os: osx + osx_image: xcode11.2 + compiler: clang + name: OSX Clang Debug + + - env: COMPILER=clang++ BUILD_TYPE=Release + os: osx + osx_image: xcode11.2 + compiler: clang + name: OSX Clang Release + + # TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos + + # Clang on Linux + - env: COMPILER=clang++-8 BUILD_TYPE=Debug + addons: &clang80 + apt: + packages: + - clang-8 + - g++-9 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-7 + name: Linux Clang Debug + + - env: COMPILER=clang++-8 BUILD_TYPE=Release + addons: *clang80 + name: Linux Clang Release + + # GCC on Linux + - env: COMPILER=g++-9 BUILD_TYPE=Debug + addons: &gcc9 + apt: + packages: + - g++-9 + sources: + - ubuntu-toolchain-r-test + name: Linux GCC Debug + + - env: COMPILER=g++-9 BUILD_TYPE=Release + addons: *gcc9 + name: Linux GCC Release + +before_install: + # Display available disk space + - df -h + + # Display Travis OS name + - echo $TRAVIS_OS_NAME + + # Display build type + - echo $BUILD_TYPE + +install: + # Set ${CXX} properly + - export CXX=${COMPILER} + + # Display compiler version + - ${CXX} --version + + # Get number of cores (or 2 by default if somehow none of these are available somehow) + - JOBS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo 2) + - echo $JOBS + + # Recommanded build directory + - CMAKE_BUILD_DIR=build + + # Install ccache on OSX + - | + if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then + # This is OSX + brew install ccache || brew upgrade cmake + export PATH="/usr/local/opt/ccache/libexec:$PATH" + fi + + # Install required libraries + - mkdir travisLibs && cd travisLibs + + # Install modern CMake + - CMAKE_VERSION=3.14.5 + - | + if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then + # This is Linux + CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz" + CMAKE_DIR=cmakeDownload + mkdir ${CMAKE_DIR} && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} + export PATH=${PWD}/${CMAKE_DIR}/bin:${PATH} + else + # This is OSX + brew install cmake || brew upgrade cmake + fi + + # Display CMake version + - cmake --version + + # Install modern SDL2 + - SDL2_VERSION=2.0.10 + - | + travis_retry curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz | tar xz + cd SDL2-${SDL2_VERSION} + ./configure + make -j ${JOBS} + sudo make install -j ${JOBS} + cd .. + + # Finished installing required libraries + - cd .. + +before_script: + # Make build directory and generate CMake build files + - mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR} + - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DFIX_BUGS=ON -DWARNINGS=ON -DALL_WARNINGS=ON + +script: + # CMake build + - cmake --build . --config ${BUILD_TYPE} --parallel ${JOBS} + + # Make build + - cd .. + - make -j ${JOBS} FIX_BUGS=1 RELEASE=1 WARNINGS=1 ALL_WARNINGS=1 + - cd ${CMAKE_BUILD_DIR} From 7401ae6643458ff33697a99b8710945b2d6e83dc Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:03:37 +0100 Subject: [PATCH 03/23] Correct tabs to spaces Signed-off-by: Gabriel Ravier --- .travis.yml | 56 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index ecca509a..cbf8ecf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ # Optimize git clone git: - depth: 5 + depth: 5 # No need for sudo sudo: false @@ -33,7 +33,7 @@ matrix: compiler: clang name: OSX Clang Release - # TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos + # TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos # Clang on Linux - env: COMPILER=clang++-8 BUILD_TYPE=Debug @@ -89,19 +89,19 @@ install: # Recommanded build directory - CMAKE_BUILD_DIR=build - # Install ccache on OSX - - | - if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then - # This is OSX - brew install ccache || brew upgrade cmake - export PATH="/usr/local/opt/ccache/libexec:$PATH" - fi + # Install ccache on OSX + - | + if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then + # This is OSX + brew install ccache || brew upgrade cmake + export PATH="/usr/local/opt/ccache/libexec:$PATH" + fi - # Install required libraries - - mkdir travisLibs && cd travisLibs + # Install required libraries + - mkdir travisLibs && cd travisLibs - # Install modern CMake - - CMAKE_VERSION=3.14.5 + # Install modern CMake + - CMAKE_VERSION=3.14.5 - | if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then # This is Linux @@ -114,32 +114,32 @@ install: brew install cmake || brew upgrade cmake fi - # Display CMake version - - cmake --version + # Display CMake version + - cmake --version - # Install modern SDL2 - - SDL2_VERSION=2.0.10 + # Install modern SDL2 + - SDL2_VERSION=2.0.10 - | travis_retry curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz | tar xz cd SDL2-${SDL2_VERSION} ./configure make -j ${JOBS} sudo make install -j ${JOBS} - cd .. + cd .. - # Finished installing required libraries - - cd .. + # Finished installing required libraries + - cd .. before_script: - # Make build directory and generate CMake build files - - mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR} + # Make build directory and generate CMake build files + - mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR} - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DFIX_BUGS=ON -DWARNINGS=ON -DALL_WARNINGS=ON script: - # CMake build - - cmake --build . --config ${BUILD_TYPE} --parallel ${JOBS} + # CMake build + - cmake --build . --config ${BUILD_TYPE} --parallel ${JOBS} - # Make build - - cd .. - - make -j ${JOBS} FIX_BUGS=1 RELEASE=1 WARNINGS=1 ALL_WARNINGS=1 - - cd ${CMAKE_BUILD_DIR} + # Make build + - cd .. + - make -j ${JOBS} FIX_BUGS=1 RELEASE=1 WARNINGS=1 ALL_WARNINGS=1 + - cd ${CMAKE_BUILD_DIR} From d013418ee2cb12a473f6fea1b7d332428fccedf3 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:12:34 +0100 Subject: [PATCH 04/23] Made it so clang should work Signed-off-by: Gabriel Ravier --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cbf8ecf9..c1760a7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,8 @@ matrix: - g++-9 sources: - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-7 + - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' name: Linux Clang Debug - env: COMPILER=clang++-8 BUILD_TYPE=Release From 65502fd809de4bccc56f2e29d82ec4b67f4115fd Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:20:46 +0100 Subject: [PATCH 05/23] Fix Makefile Signed-off-by: Gabriel Ravier --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d805c463..b1062cd1 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ ifeq ($(WARNINGS), 1) endif ifeq ($(ALL_WARNINGS), 1) - ifneq ($(findstring clang,$(CXX),) + ifneq ($(findstring clang,$(CXX),)) # Use clang-specific flag -Weverything CXXFLAGS += -Weverything else From dcede9c931c4c9f80b0eaaa26db593d22454c124 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:29:08 +0100 Subject: [PATCH 06/23] Fixup package download and use clang 9 Signed-off-by: Gabriel Ravier --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1760a7c..94504d59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,19 +36,19 @@ matrix: # TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos # Clang on Linux - - env: COMPILER=clang++-8 BUILD_TYPE=Debug + - env: COMPILER=clang++-9 BUILD_TYPE=Debug addons: &clang80 apt: packages: - - clang-8 + - clang-9 - g++-9 sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main' + - sourceline: 'ppa:ubuntu-toolchain-r/test' + - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main' key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' name: Linux Clang Debug - - env: COMPILER=clang++-8 BUILD_TYPE=Release + - env: COMPILER=clang++-9 BUILD_TYPE=Release addons: *clang80 name: Linux Clang Release From 11d1097af72dbc02d9d7f60a561e1fe3e1dcf04a Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:33:33 +0100 Subject: [PATCH 07/23] Attempt to fix .travis.yml Signed-off-by: Gabriel Ravier --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 94504d59..05f1b131 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,6 @@ matrix: apt: packages: - clang-9 - - g++-9 sources: - sourceline: 'ppa:ubuntu-toolchain-r/test' - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main' From 40ba60cb8e35f44cb1f9e563bb004c9cac84ea33 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Thu, 31 Oct 2019 21:05:06 +0100 Subject: [PATCH 08/23] Started basic .travis.yml setup --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..759269dc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: cpp + +compiler: + - clang + - gcc + +dist: + - trusty From 0f126a77953006cb63802885923011039b02189d Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 12:53:48 +0100 Subject: [PATCH 09/23] Added some more .travis.yml support Signed-off-by: Gabriel Ravier --- .travis.yml | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 142 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 759269dc..ecca509a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,145 @@ +# Optimize git clone +git: + depth: 5 + +# No need for sudo +sudo: false + +# Use linux unless specified otherwise +os: linux + +# Bionic is the most recent version of Ubuntu I can get to work properly +dist: bionic + +# Enable C++ language support language: cpp -compiler: - - clang - - gcc +# Cache compiled object files with ccache +cache: ccache -dist: - - trusty +# Matrix for configuring all the build configurations +matrix: + include: + # Clang on OSX + - env: COMPILER=clang++ BUILD_TYPE=Debug + os: osx + osx_image: xcode11.2 + compiler: clang + name: OSX Clang Debug + + - env: COMPILER=clang++ BUILD_TYPE=Release + os: osx + osx_image: xcode11.2 + compiler: clang + name: OSX Clang Release + + # TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos + + # Clang on Linux + - env: COMPILER=clang++-8 BUILD_TYPE=Debug + addons: &clang80 + apt: + packages: + - clang-8 + - g++-9 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-7 + name: Linux Clang Debug + + - env: COMPILER=clang++-8 BUILD_TYPE=Release + addons: *clang80 + name: Linux Clang Release + + # GCC on Linux + - env: COMPILER=g++-9 BUILD_TYPE=Debug + addons: &gcc9 + apt: + packages: + - g++-9 + sources: + - ubuntu-toolchain-r-test + name: Linux GCC Debug + + - env: COMPILER=g++-9 BUILD_TYPE=Release + addons: *gcc9 + name: Linux GCC Release + +before_install: + # Display available disk space + - df -h + + # Display Travis OS name + - echo $TRAVIS_OS_NAME + + # Display build type + - echo $BUILD_TYPE + +install: + # Set ${CXX} properly + - export CXX=${COMPILER} + + # Display compiler version + - ${CXX} --version + + # Get number of cores (or 2 by default if somehow none of these are available somehow) + - JOBS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo 2) + - echo $JOBS + + # Recommanded build directory + - CMAKE_BUILD_DIR=build + + # Install ccache on OSX + - | + if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then + # This is OSX + brew install ccache || brew upgrade cmake + export PATH="/usr/local/opt/ccache/libexec:$PATH" + fi + + # Install required libraries + - mkdir travisLibs && cd travisLibs + + # Install modern CMake + - CMAKE_VERSION=3.14.5 + - | + if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then + # This is Linux + CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz" + CMAKE_DIR=cmakeDownload + mkdir ${CMAKE_DIR} && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} + export PATH=${PWD}/${CMAKE_DIR}/bin:${PATH} + else + # This is OSX + brew install cmake || brew upgrade cmake + fi + + # Display CMake version + - cmake --version + + # Install modern SDL2 + - SDL2_VERSION=2.0.10 + - | + travis_retry curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz | tar xz + cd SDL2-${SDL2_VERSION} + ./configure + make -j ${JOBS} + sudo make install -j ${JOBS} + cd .. + + # Finished installing required libraries + - cd .. + +before_script: + # Make build directory and generate CMake build files + - mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR} + - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DFIX_BUGS=ON -DWARNINGS=ON -DALL_WARNINGS=ON + +script: + # CMake build + - cmake --build . --config ${BUILD_TYPE} --parallel ${JOBS} + + # Make build + - cd .. + - make -j ${JOBS} FIX_BUGS=1 RELEASE=1 WARNINGS=1 ALL_WARNINGS=1 + - cd ${CMAKE_BUILD_DIR} From 1d9f16af3a9675c8cbb0d148720e02009fbee356 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:03:37 +0100 Subject: [PATCH 10/23] Correct tabs to spaces Signed-off-by: Gabriel Ravier --- .travis.yml | 56 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index ecca509a..cbf8ecf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ # Optimize git clone git: - depth: 5 + depth: 5 # No need for sudo sudo: false @@ -33,7 +33,7 @@ matrix: compiler: clang name: OSX Clang Release - # TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos + # TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos # Clang on Linux - env: COMPILER=clang++-8 BUILD_TYPE=Debug @@ -89,19 +89,19 @@ install: # Recommanded build directory - CMAKE_BUILD_DIR=build - # Install ccache on OSX - - | - if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then - # This is OSX - brew install ccache || brew upgrade cmake - export PATH="/usr/local/opt/ccache/libexec:$PATH" - fi + # Install ccache on OSX + - | + if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then + # This is OSX + brew install ccache || brew upgrade cmake + export PATH="/usr/local/opt/ccache/libexec:$PATH" + fi - # Install required libraries - - mkdir travisLibs && cd travisLibs + # Install required libraries + - mkdir travisLibs && cd travisLibs - # Install modern CMake - - CMAKE_VERSION=3.14.5 + # Install modern CMake + - CMAKE_VERSION=3.14.5 - | if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then # This is Linux @@ -114,32 +114,32 @@ install: brew install cmake || brew upgrade cmake fi - # Display CMake version - - cmake --version + # Display CMake version + - cmake --version - # Install modern SDL2 - - SDL2_VERSION=2.0.10 + # Install modern SDL2 + - SDL2_VERSION=2.0.10 - | travis_retry curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz | tar xz cd SDL2-${SDL2_VERSION} ./configure make -j ${JOBS} sudo make install -j ${JOBS} - cd .. + cd .. - # Finished installing required libraries - - cd .. + # Finished installing required libraries + - cd .. before_script: - # Make build directory and generate CMake build files - - mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR} + # Make build directory and generate CMake build files + - mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR} - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DFIX_BUGS=ON -DWARNINGS=ON -DALL_WARNINGS=ON script: - # CMake build - - cmake --build . --config ${BUILD_TYPE} --parallel ${JOBS} + # CMake build + - cmake --build . --config ${BUILD_TYPE} --parallel ${JOBS} - # Make build - - cd .. - - make -j ${JOBS} FIX_BUGS=1 RELEASE=1 WARNINGS=1 ALL_WARNINGS=1 - - cd ${CMAKE_BUILD_DIR} + # Make build + - cd .. + - make -j ${JOBS} FIX_BUGS=1 RELEASE=1 WARNINGS=1 ALL_WARNINGS=1 + - cd ${CMAKE_BUILD_DIR} From 67f5fb6a4a1867dc42f0e470c33b264f61b85c9a Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:12:34 +0100 Subject: [PATCH 11/23] Made it so clang should work Signed-off-by: Gabriel Ravier --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cbf8ecf9..c1760a7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,8 @@ matrix: - g++-9 sources: - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-7 + - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' name: Linux Clang Debug - env: COMPILER=clang++-8 BUILD_TYPE=Release From 0fa7da832432cae284259f7310e42c532eac4fe3 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:29:08 +0100 Subject: [PATCH 12/23] Fixup package download and use clang 9 Signed-off-by: Gabriel Ravier --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1760a7c..94504d59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,19 +36,19 @@ matrix: # TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos # Clang on Linux - - env: COMPILER=clang++-8 BUILD_TYPE=Debug + - env: COMPILER=clang++-9 BUILD_TYPE=Debug addons: &clang80 apt: packages: - - clang-8 + - clang-9 - g++-9 sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main' + - sourceline: 'ppa:ubuntu-toolchain-r/test' + - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main' key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' name: Linux Clang Debug - - env: COMPILER=clang++-8 BUILD_TYPE=Release + - env: COMPILER=clang++-9 BUILD_TYPE=Release addons: *clang80 name: Linux Clang Release From 7fb44800dda4188961ce7e58fec5ec886bf2a487 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:33:33 +0100 Subject: [PATCH 13/23] Attempt to fix .travis.yml Signed-off-by: Gabriel Ravier --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 94504d59..05f1b131 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,6 @@ matrix: apt: packages: - clang-9 - - g++-9 sources: - sourceline: 'ppa:ubuntu-toolchain-r/test' - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main' From d0e59844e411e6fefa43214a268df48ed9d73333 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:46:17 +0100 Subject: [PATCH 14/23] Attempt to make Travis-CI work Signed-off-by: Gabriel Ravier --- .travis.yml | 118 ++++++++++++++++++++++------------------------------ 1 file changed, 50 insertions(+), 68 deletions(-) diff --git a/.travis.yml b/.travis.yml index 05f1b131..ac28a63d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,6 @@ git: # No need for sudo sudo: false -# Use linux unless specified otherwise -os: linux - # Bionic is the most recent version of Ubuntu I can get to work properly dist: bionic @@ -17,53 +14,37 @@ language: cpp # Cache compiled object files with ccache cache: ccache -# Matrix for configuring all the build configurations -matrix: - include: - # Clang on OSX - - env: COMPILER=clang++ BUILD_TYPE=Debug - os: osx - osx_image: xcode11.2 - compiler: clang - name: OSX Clang Debug +osx_image: xcode11.2 - - env: COMPILER=clang++ BUILD_TYPE=Release - os: osx - osx_image: xcode11.2 - compiler: clang - name: OSX Clang Release +compiler: + - gcc + - clang - # TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos +os: + - linux + - osx - # Clang on Linux - - env: COMPILER=clang++-9 BUILD_TYPE=Debug - addons: &clang80 - apt: - packages: - - clang-9 - sources: - - sourceline: 'ppa:ubuntu-toolchain-r/test' - - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - name: Linux Clang Debug +addons: + apt: + sources: + - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' + - sourceline: 'ppa:ubuntu-toolchain-r/test' + packages: + - clang-9 + - cmake + - gcc-9 + - g++-9 + homebrew: + packages: + - cmake + - gcc@9 + - llvm@9 + update: true - - env: COMPILER=clang++-9 BUILD_TYPE=Release - addons: *clang80 - name: Linux Clang Release - - # GCC on Linux - - env: COMPILER=g++-9 BUILD_TYPE=Debug - addons: &gcc9 - apt: - packages: - - g++-9 - sources: - - ubuntu-toolchain-r-test - name: Linux GCC Debug - - - env: COMPILER=g++-9 BUILD_TYPE=Release - addons: *gcc9 - name: Linux GCC Release +env: + - BUILD_TYPE=Debug + - BUILD_TYPE=RelWithDebInfo before_install: # Display available disk space @@ -75,13 +56,31 @@ before_install: # Display build type - echo $BUILD_TYPE -install: - # Set ${CXX} properly - - export CXX=${COMPILER} + # The following Homebrew packages aren't linked by default, and need to be prepended to the path explicitly. + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then + export PATH="$(brew --prefix llvm)/bin:$PATH"; + fi - # Display compiler version + # /usr/bin/gcc points to an older compiler on both Linux and macOS. + - if [ "$CXX" = "g++" ]; then export CXX="g++-9" CC="gcc-9"; fi + + # /usr/bin/clang points to an older compiler on both Linux and macOS. + # + # Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values + # below don't work on macOS. Fortunately, the path change above makes the + # default values (clang and clang++) resolve to the correct compiler on macOS. + - if [ "$TRAVIS_OS_NAME" = "linux" ]; then + if [ "$CXX" = "clang++" ]; then export CXX="clang++-9" CC="clang-9"; fi; + fi + + # Display compilers/cmake name/version + - echo ${CC} + - echo ${CXX} + - ${CC} --version - ${CXX} --version + - cmake --version +install: # Get number of cores (or 2 by default if somehow none of these are available somehow) - JOBS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo 2) - echo $JOBS @@ -93,30 +92,13 @@ install: - | if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then # This is OSX - brew install ccache || brew upgrade cmake + brew install ccache export PATH="/usr/local/opt/ccache/libexec:$PATH" fi # Install required libraries - mkdir travisLibs && cd travisLibs - # Install modern CMake - - CMAKE_VERSION=3.14.5 - - | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then - # This is Linux - CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz" - CMAKE_DIR=cmakeDownload - mkdir ${CMAKE_DIR} && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} - export PATH=${PWD}/${CMAKE_DIR}/bin:${PATH} - else - # This is OSX - brew install cmake || brew upgrade cmake - fi - - # Display CMake version - - cmake --version - # Install modern SDL2 - SDL2_VERSION=2.0.10 - | From bc448d0de64480a6dba4943fce7aa157e8f261c5 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 13:59:31 +0100 Subject: [PATCH 15/23] Remove extraneous comma in Makefile Signed-off-by: Gabriel Ravier --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b1062cd1..a597b77f 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ ifeq ($(WARNINGS), 1) endif ifeq ($(ALL_WARNINGS), 1) - ifneq ($(findstring clang,$(CXX),)) + ifneq ($(findstring clang,$(CXX))) # Use clang-specific flag -Weverything CXXFLAGS += -Weverything else From d5099a094ba96568a2e514bafa657c85de0c6306 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 14:21:39 +0100 Subject: [PATCH 16/23] Attempt to fix Travis-CI build Signed-off-by: Gabriel Ravier --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a597b77f..4853a144 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ ifeq ($(WARNINGS), 1) endif ifeq ($(ALL_WARNINGS), 1) - ifneq ($(findstring clang,$(CXX))) + ifneq ($(findstring clang,$(CXX)),) # Use clang-specific flag -Weverything CXXFLAGS += -Weverything else From 33d734cb17cd553f3d93b648890338501d38e5f7 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 15:07:29 +0100 Subject: [PATCH 17/23] Use $(warning message) instead of e@cho Signed-off-by: Gabriel Ravier --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4853a144..7c524515 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ ifeq ($(ALL_WARNINGS), 1) # Use clang-specific flag -Weverything CXXFLAGS += -Weverything else - @echo Couldn\'t activate all warnings (Unsupported compiler) + $(warning Couldn\'t activate all warnings (Unsupported compiler)) endif endif From 6136911976b38e681e1927c55b3251792eb88a3a Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 15:28:05 +0100 Subject: [PATCH 18/23] Try to fix Makefile by using spaces instead of tabs Signed-off-by: Gabriel Ravier --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7c524515..49ec9169 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,8 @@ ifeq ($(ALL_WARNINGS), 1) # Use clang-specific flag -Weverything CXXFLAGS += -Weverything else - $(warning Couldn\'t activate all warnings (Unsupported compiler)) + # This is indented with spaces because otherwise it doesn't compile (make doesn't like tabs there for some reason + $(warning Couldn\'t activate all warnings (Unsupported compiler)) endif endif From f015ebec79cbf19a27c01177eeeb0328f29db725 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 15:40:13 +0100 Subject: [PATCH 19/23] Add parenthesis at end of comment Signed-off-by: Gabriel Ravier --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 49ec9169..d80c6cba 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ ifeq ($(ALL_WARNINGS), 1) # Use clang-specific flag -Weverything CXXFLAGS += -Weverything else - # This is indented with spaces because otherwise it doesn't compile (make doesn't like tabs there for some reason + # This is indented with spaces because otherwise it doesn't compile (make doesn't like tabs there for some reason) $(warning Couldn\'t activate all warnings (Unsupported compiler)) endif endif From 7dc506a92e640075f9413a08ac54522967d52ff4 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 16:40:38 +0100 Subject: [PATCH 20/23] Travis-CI : Added dev packages which might just fix the build Signed-off-by: Gabriel Ravier --- .travis.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac28a63d..01eca071 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,19 +27,29 @@ os: addons: apt: sources: - - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - sourceline: 'ppa:ubuntu-toolchain-r/test' + - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' + - sourceline: 'ppa:ubuntu-toolchain-r/test' packages: - - clang-9 - - cmake - - gcc-9 - - g++-9 + - cmake + - gcc-9 + - g++-9 + - clang-9 + - libsdl2-dev + - libfreetype6-dev + - libfltk-dev + - libglew-dev + - libxmp-dev homebrew: packages: - - cmake - - gcc@9 - - llvm@9 + - cmake + - gcc@9 + - llvm@9 + - sdl2 + - freetype + - fltk + - glew + - libxmp-lite update: true env: From 87c8ae2428a9f0fffb68e0b96e9a78ee74064e66 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 16:44:13 +0100 Subject: [PATCH 21/23] Travis-CI : Fixed fltk package name Signed-off-by: Gabriel Ravier --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 01eca071..072ec9c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ addons: - clang-9 - libsdl2-dev - libfreetype6-dev - - libfltk-dev + - libfltk1.3-dev - libglew-dev - libxmp-dev homebrew: From d3a1e74facd9bf8ef6cf653b06beef1832a0cdd3 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 18:20:47 +0100 Subject: [PATCH 22/23] Travis-CI : Attempt to remove manual building from source of SDL2 Signed-off-by: Gabriel Ravier --- .travis.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 072ec9c6..57947a39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -109,16 +109,6 @@ install: # Install required libraries - mkdir travisLibs && cd travisLibs - # Install modern SDL2 - - SDL2_VERSION=2.0.10 - - | - travis_retry curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz | tar xz - cd SDL2-${SDL2_VERSION} - ./configure - make -j ${JOBS} - sudo make install -j ${JOBS} - cd .. - # Finished installing required libraries - cd .. From 8c6f1381f0fa08772fe0a21bd2e182ca836df2f8 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Fri, 1 Nov 2019 19:20:28 +0100 Subject: [PATCH 23/23] Add Discord supoprt Signed-off-by: Gabriel Ravier --- .travis.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.travis.yml b/.travis.yml index 57947a39..36afa576 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,10 @@ env: - BUILD_TYPE=RelWithDebInfo before_install: + # Set URL for Discord send script + - DISCORD_SEND_SCRIPT_URL=https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh + - DISCORD_SEND_SCRIPT_FILENAME=discordSendNotification.sh + # Display available disk space - df -h @@ -125,3 +129,15 @@ script: - cd .. - make -j ${JOBS} FIX_BUGS=1 RELEASE=1 WARNINGS=1 ALL_WARNINGS=1 - cd ${CMAKE_BUILD_DIR} + +after_success: + # Send success notification to Discord through DISCORD_WEBHOOK_URL + - travis_retry wget ${DISCORD_SEND_SCRIPT_URL} -O ${DISCORD_SEND_SCRIPT_FILENAME} + - chmod +x ${DISCORD_SEND_SCRIPT_FILENAME} + - ./${DISCORD_SEND_SCRIPT_FILENAME} success $DISCORD_WEBHOOK_URL + +after_failure: + # Send failure notification to Discord through DISCORD_WEBHOOK_URL + - travis_retry wget ${DISCORD_SEND_SCRIPT_URL} -O ${DISCORD_SEND_SCRIPT_FILENAME} + - chmod +x ${DISCORD_SEND_SCRIPT_FILENAME} + - ./${DISCORD_SEND_SCRIPT_FILENAME} failure $DISCORD_WEBHOOK_URL