Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CMake 3.10-3.20 #2532

Merged
merged 4 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/stable-compilation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Stable Compilation

on:
push:
pull_request:
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
docker:
name: ${{ matrix.image }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}

strategy:
fail-fast: false
matrix:
image:
- ubuntu:18.04 # CMake 3.10.2 - g++ 7.4.0 - LTS
- debian:10 # CMake 3.13.4 - g++ 8.3.0 - old
- ubuntu:20.04 # CMake 3.16.3 - g++ 9.3.0 - LTS
- ubuntu:21.04 # CMake 3.18.4 - g++ 10.3.0 - stable

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]

- name: Checkout
uses: actions/checkout@v2

- name: Install ppa for new libfmt
if: matrix.image == 'ubuntu:18.04'
run: |
apt-get update
apt-get install -yqq software-properties-common
add-apt-repository ppa:team-xbmc/ppa

- name: Install dependencies
run: |
export DEBIAN_FRONTEND="noninteractive"
apt-get update
apt-get install -yqq --no-install-recommends --no-install-suggests \
ca-certificates build-essential cmake ninja-build git \
libicu-dev libexpat1-dev libsdl2-dev libpng-dev libpixman-1-dev \
libfmt-dev libfreetype6-dev libharfbuzz-dev libmpg123-dev \
libsndfile-dev libvorbis-dev libopusfile-dev libspeexdsp-dev \
libdrm-dev libgbm-dev # only needed for sdl2 on ubuntu 21.04

- name: Compile
run: |
mkdir build
cd build
# cmake < 3.13 does not support '-B'
cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
-DPLAYER_BUILD_LIBLCF=ON
cmake --build .

- name: Install
run: |
# cmake < 3.16 does not support '--install'
cmake --build build --target install

- name: Test
run: cmake --build build --target check
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.7)

if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW) # Support MSVC_RUNTIME_LIBRARY
cmake_minimum_required(VERSION 3.10...3.20 FATAL_ERROR)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
# Use most recent policies, even for older cmake
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()

project(EasyRPG_Player VERSION 0.6.2 LANGUAGES CXX)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ https://wiki.easyrpg.org/development/compiling/player/autotools
Building requirements:

- pkg-config (only on Linux)
- CMake 3.7 or newer
- CMake 3.10 or newer

Step-by-step instructions:

Expand Down
5 changes: 5 additions & 0 deletions src/string_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
#include <lcf/dbstring.h>
#include <fmt/core.h>

// FIXME: needed to allow building with fmt 5, older versions are untested.
#if FMT_VERSION < 60000
#include <fmt/ostream.h>
#endif

using StringView = lcf::StringView;

using lcf::ToString;
Expand Down