Skip to content

Commit

Permalink
Update workflow and CMake config
Browse files Browse the repository at this point in the history
Minimum supported is CMake version 3.16 now
Drop fmt 5 support with debian 10
  • Loading branch information
carstene1ns committed Dec 31, 2023
1 parent 4339d51 commit 0b64671
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/stable-compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
description: Git Ref (Optional)
required: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash
Expand All @@ -24,15 +28,12 @@ jobs:
fail-fast: false
matrix:
image:
- debian:10 # oldstable | CMake 3.13.4 | G++ 8.3.0 | SDL 2.0.9
- ubuntu:20.04 # LTS | CMake 3.16.3 | G++ 9.3.0 | SDL 2.0.10
- debian:11 # stable | CMake 3.18.4 | G++ 10.2.1 | SDL 2.0.14
- ubuntu:22.04 # LTS | CMake 3.22.1 | G++ 11.2.0 | SDL 2.0.20
- ubuntu:20.04 # LTS (4/25) | CMake 3.16.3 | G++ 9.3.0 | SDL 2.0.10
- debian:11 # old (8/24) | CMake 3.18.4 | G++ 10.2.1 | SDL 2.0.14
- ubuntu:22.04 # LTS (6/27) | CMake 3.22.1 | G++ 11.2.0 | SDL 2.0.20
- debian:12 # stbl (6/26) | CMake 3.25.1 | G++ 12.2.0 | SDL 2.26.5

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

- name: Install dependencies
run: |
export DEBIAN_FRONTEND="noninteractive"
Expand All @@ -45,10 +46,10 @@ jobs:
libdrm-dev libgbm-dev # only needed for sdl2 on debian 11
- name: Clone Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
if: github.event.inputs.git-ref == ''
- name: Clone Repository (with custom ref)
uses: actions/checkout@v2
uses: actions/checkout@v4
if: github.event.inputs.git-ref != ''
with:
ref: ${{ github.event.inputs.git-ref }}
Expand All @@ -63,8 +64,7 @@ jobs:
- name: Install
run: |
# cmake < 3.16 does not support '--install'
cmake --build build --target install
cmake --install build
- name: Test
run: |
Expand Down
21 changes: 10 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13...3.24 FATAL_ERROR)
cmake_minimum_required(VERSION 3.16...3.24 FATAL_ERROR)

project(EasyRPG_Player VERSION 0.8
DESCRIPTION "Interpreter for RPG Maker 2000/2003 games"
Expand All @@ -22,9 +22,7 @@ set(CMAKE_CXX_EXTENSIONS ON)
# Must be at global scope, otherwise breaks -DPLAYER_BUILD_LIBLCF (see CMP0077)
option(BUILD_SHARED_LIBS "Build shared easyrpg_libretro core" ON)

if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.15.0")
option(CMAKE_FIND_PACKAGE_PREFER_CONFIG "Prefer config files over bundled FindXXX files. Set this to OFF when configuration fails and report a bug." ON)
endif()
option(CMAKE_FIND_PACKAGE_PREFER_CONFIG "Prefer config files over bundled FindXXX files. Set this to OFF when configuration fails and report a bug." ON)

# Source Files
add_library(${PROJECT_NAME} OBJECT
Expand Down Expand Up @@ -740,8 +738,10 @@ endif()

if(NOT PLAYER_BUILD_EXECUTABLE AND BUILD_SHARED_LIBS)
# Need fPIC when compiling a shared library (e.g. libretro.so)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
include(CheckPIESupported)
check_pie_supported()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE TRUE)
endif()

if(ANDROID)
Expand All @@ -758,6 +758,7 @@ if(WIN32)
endif()

if(APPLE)
enable_language(OBJCXX)
target_sources(${PROJECT_NAME} PRIVATE
src/platform/macos/macos_utils.mm
src/platform/macos/macos_utils.h
Expand Down Expand Up @@ -911,11 +912,9 @@ if(${PLAYER_AUDIO_BACKEND} MATCHES "^(SDL2|SDL1|libretro|psvita|3ds|switch|wii|a
if(WIN32 OR APPLE)
set(SUPPORT_NATIVE_MIDI ON)
elseif(UNIX)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.12)
find_package(ALSA)
if(ALSA_FOUND)
set(SUPPORT_NATIVE_MIDI ON)
endif()
find_package(ALSA)
if(ALSA_FOUND)
set(SUPPORT_NATIVE_MIDI ON)
endif()
endif()

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

// 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 U32StringView = lcf::U32StringView;

Expand Down

0 comments on commit 0b64671

Please sign in to comment.