Skip to content

Feature/spdlog logger #18

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

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
7c254cd
CMakeLists: remove ancient unused variable.
Lord-Kamina Sep 9, 2024
5b8ee58
Fix libfmt detection in bundler
Lord-Kamina Oct 17, 2024
263db2a
Use spdlog header-only
Lord-Kamina Oct 17, 2024
3c82f87
Implement logger subsystems as an enum.
Lord-Kamina Oct 28, 2024
985f426
Try to enable StdErrGrabber on windows.
Lord-Kamina Oct 28, 2024
5a1a5e5
Initial implementation of Spdlog
Lord-Kamina Oct 28, 2024
d45f4cb
Redirect stderr to Spdlog.
Lord-Kamina Oct 28, 2024
af27dc7
Add spdlog to CI workflows
Lord-Kamina Oct 28, 2024
7db5824
debug statements
Lord-Kamina Oct 29, 2024
c09821b
fix cmake ?
Lord-Kamina Oct 29, 2024
b34cc9a
Use string-view literals
Lord-Kamina Oct 29, 2024
14a984e
debugging find_package
Lord-Kamina Oct 29, 2024
96aa6ec
Explicitly allow fmt11 on macOS
Lord-Kamina Oct 29, 2024
b08065c
Remove unused log include from platform.hh
Lord-Kamina Oct 30, 2024
04367aa
Try to fix grabber macros for windows.
Lord-Kamina Oct 30, 2024
f6d06e8
Boost file descriptors are not int on windows.
Lord-Kamina Oct 30, 2024
4800efc
Can I get away with just this?
Lord-Kamina Nov 4, 2024
639b2e5
Move logger_color_codes to source-file
Lord-Kamina Nov 4, 2024
08138ff
Fix mingw warning-as-error
Lord-Kamina Nov 4, 2024
a5a2525
Try attaching to console
Lord-Kamina Nov 4, 2024
689d503
Am I getting an invalid filedescriptor?
Lord-Kamina Nov 4, 2024
ebd5870
Destroy grabber along with SpdLogger
Lord-Kamina Nov 5, 2024
9ae2b91
explicitly set m_sink level to trace, maybe?
Lord-Kamina Nov 5, 2024
f49813f
fix indent in platform
Lord-Kamina Nov 5, 2024
37821a0
Move console init to Platform initialization
Lord-Kamina Nov 5, 2024
83a8072
Try to fix log message pattern not working
Lord-Kamina Nov 5, 2024
d9c7ea1
Can we get away with not doing AllocConsole?
Lord-Kamina Nov 6, 2024
e839bfb
FreeConsole shouldn’t be on the Grabber anymore.
Lord-Kamina Nov 7, 2024
0402b19
cstdio instead of stdio.h
Lord-Kamina Nov 7, 2024
3cc6734
debug messages to see what’s going on
Lord-Kamina Nov 7, 2024
4363970
Put logger up-top in platform maybe?
Lord-Kamina Nov 7, 2024
51af259
maybe do reopen only if we have a console?
Lord-Kamina Nov 8, 2024
1a5c23b
Let’s try another approach
Lord-Kamina Nov 9, 2024
1745a9a
Put logger at the beginning of main for now.
Lord-Kamina Nov 10, 2024
297ecbd
Open stderr but not stdout if no console
Lord-Kamina Nov 10, 2024
3a443b7
Cleanup Platform: back to instance, use unique_ptr
Lord-Kamina Nov 10, 2024
07674ae
Allow finding Spdlog with FetchContent.
Lord-Kamina Nov 11, 2024
c4dd20c
Containers: Use updated cmake on older distros
Lord-Kamina Nov 11, 2024
f9ff363
Require libfmt8, ppa for focal and bullseye
Lord-Kamina Nov 13, 2024
4e19ed8
Try to use an older gcc on fedora 39
Lord-Kamina Nov 14, 2024
de55ea8
Maybe clang?
Lord-Kamina Nov 14, 2024
a6b3992
Clean-up the dockerfiles a bit.
Lord-Kamina Nov 14, 2024
3bdfbba
Clean-up log code a bit.
Lord-Kamina Nov 15, 2024
55d3e36
Delete fs library remnants
Lord-Kamina Dec 15, 2024
d6e85a1
Replace logger in audio,.
Lord-Kamina Dec 16, 2024
77226cb
Replace log in controllers.
Lord-Kamina Dec 17, 2024
bb918ae
Refactor XML++ helpers
Lord-Kamina Dec 16, 2024
2ce077e
Replace logger in code relating to OpenGL.
Lord-Kamina Dec 17, 2024
6ba3470
Replace logger in screens, cam, ffmpeg and video.
Lord-Kamina Dec 17, 2024
0c94860
Replace logger in bg/color/image/svg/texture
Lord-Kamina Dec 17, 2024
052ce7c
Fix logger in song/songparsers/midifile/tone
Lord-Kamina Dec 17, 2024
9f7b1d7
Fix logger in fs/db/config/json/menu/platform
Lord-Kamina Dec 17, 2024
fd9030e
Fix logger in game/guitar/main/profiler/unicode
Lord-Kamina Dec 17, 2024
2fde229
fix logger in webserver/requesthandler
Lord-Kamina Dec 17, 2024
273d56b
Remove remnants of the old logger.
Lord-Kamina Dec 17, 2024
20dac5c
Various fixes and clean-up on the new logger.
Lord-Kamina Dec 17, 2024
bb431e0
Few fixes to tests. Normalize line-endings.
Lord-Kamina Dec 17, 2024
2f37614
Fix fatalError function.
Lord-Kamina Dec 17, 2024
1ac70ef
Catch error in getLogger
Lord-Kamina Dec 23, 2024
164bb6d
Rename Song::LoadStatus::ERROR, far and near.
Lord-Kamina Jan 14, 2025
55fe127
ugh
Lord-Kamina Jan 14, 2025
80f3b42
change warn color
Lord-Kamina Jan 14, 2025
58d104f
Downgrade “Audio device not found” to WARNING.
Lord-Kamina Jan 14, 2025
03828f4
hopefully fix win console
Lord-Kamina Jan 15, 2025
4caa286
…..
Lord-Kamina Jan 15, 2025
f7ada10
Fix stray log trace
Lord-Kamina Jan 18, 2025
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
9 changes: 8 additions & 1 deletion .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ jobs:
chmod +x appimage-builder-x86_64.AppImage
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
sudo apt update
sudo apt-get install -y --no-install-recommends git cmake build-essential gettext help2man libopenblas-dev libfftw3-dev libicu-dev libepoxy-dev libsdl2-dev libfreetype6-dev libpango1.0-dev librsvg2-dev libxml++2.6-dev libavcodec-dev libavformat-dev libswscale-dev libjpeg-dev portaudio19-dev libglm-dev libboost-filesystem-dev libboost-iostreams-dev libboost-locale-dev libboost-system-dev libboost-program-options-dev libssl-dev libcpprest-dev libgtest-dev libgmock-dev google-mock libportmidi-dev libopencv-dev libaubio-dev nlohmann-json3-dev libfmt-dev libfuse2
sudo apt-get -y install ca-certificates wget gpg
wget -O ./key.asc https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null
gpg -v -o /usr/share/keyrings/kitware-archive-keyring.gpg --dearmor ./key.asc
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get -y update
test -f /usr/share/doc/kitware-archive-keyring/copyright || sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg
sudo apt-get install kitware-archive-keyring
sudo apt-get install -y --no-install-recommends git cmake build-essential gettext help2man libopenblas-dev libfftw3-dev libicu-dev libepoxy-dev libsdl2-dev libfreetype6-dev libpango1.0-dev librsvg2-dev libxml++2.6-dev libavcodec-dev libavformat-dev libswscale-dev libjpeg-dev portaudio19-dev libglm-dev libboost-iostreams-dev libboost-locale-dev libboost-system-dev libboost-program-options-dev libssl-dev libcpprest-dev libgtest-dev libgmock-dev google-mock libportmidi-dev libopencv-dev libaubio-dev nlohmann-json3-dev libfmt-dev libfuse2 libspdlog-dev

- name: Checkout Git
id: checkout_git
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:

# Run the build inside the docker containers using the
# build script that was pulled inside during the build
docker run --env EXTRA_CMAKE_ARGS --rm -v $(pwd):/github_actions_build/ ${{ env.CONTAINER_NAME }} ./build_performous.sh -g -D /github_actions_build/ -E ${EXTRA_CMAKE_ARGS} -R ${PERFORMOUS_RELEASE_TYPE}
docker run --env EXTRA_CMAKE_ARGS --rm -v $(pwd):/github_actions_build/ ${{ env.CONTAINER_NAME }} ./build_performous.sh -g -D /github_actions_build/ -E ${EXTRA_CMAKE_ARGS} -R ${PERFORMOUS_RELEASE_TYPE}

# Provided by the common build functions
package_name "$(pwd)/build" "Performous*-Linux.*" "${PACKAGE_VERSION}" "${{ matrix.os }}" "${{ matrix.version }}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
portaudio
portmidi
sdl2
spdlog
steps:
- name: Checkout Git
id: checkout_git
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Download and build our dependencies using vcpkg
uses: Lord-Kamina/vcpkg-action@update_cache
with:
pkgs: "\"aubio[core,tools]\" \"boost-algorithm[core]\" \"boost-align[core]\" \"boost-any[core]\" \"boost-array[core]\" \"boost-assert[core]\" \"boost-asio\" \"boost-atomic[core]\" \"boost-bind[core]\" \"boost-build[core]\" \"boost-chrono[core]\" \"boost-concept-check[core]\" \"boost-config[core]\" \"boost-container[core]\" \"boost-container-hash[core]\" \"boost-conversion[core]\" \"boost-core[core]\" \"boost-date-time[core]\" \"boost-detail[core]\" \"boost-dynamic-bitset[core]\" \"boost-exception[core]\" \"boost-function[core]\" \"boost-function-types[core]\" \"boost-fusion[core]\" \"boost-integer[core]\" \"boost-intrusive[core]\" \"boost-io[core]\" \"boost-iostreams[bzip2,core,lzma,zlib,zstd]\" \"boost-iterator[core]\" \"boost-lexical-cast[core]\" \"boost-locale[core]\" \"boost-move[core]\" \"boost-mp11[core]\" \"boost-mpl[core]\" \"boost-numeric-conversion[core]\" \"boost-optional[core]\" \"boost-predef[core]\" \"boost-preprocessor[core]\" \"boost-program-options[core]\" \"boost-random[core]\" \"boost-range[core]\" \"boost-ratio[core]\" \"boost-rational[core]\" \"boost-regex[core]\" \"boost-smart-ptr[core]\" \"boost-static-assert[core]\" \"boost-system[core]\" \"boost-thread[core]\" \"boost-throw-exception[core]\" \"boost-tokenizer[core]\" \"boost-tuple[core]\" \"boost-type-index[core]\" \"boost-type-traits[core]\" \"boost-typeof[core]\" \"boost-uninstall[core]\" \"boost-unordered[core]\" \"boost-utility[core]\" \"boost-variant2[core]\" \"boost-winapi[core]\" \"brotli[core]\" \"bzip2[core,tool]\" \"cairo[core,fontconfig,freetype,gobject]\" \"dirent[core]\" \"expat[core]\" \"ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]\" \"fftw3[core]\" \"fmt[core]\" \"fontconfig[core]\" \"freetype[brotli,bzip2,core,png,zlib]\" \"fribidi[core]\" \"gdk-pixbuf[core]\" \"getopt[core]\" \"getopt-win32[core]\" \"gettext[core,tools]\" \"glib[core]\" \"glibmm[core]\" \"glm[core]\" \"gperf[core]\" \"gtest[core]\" \"harfbuzz[core]\" \"icu[*]\" \"cpprestsdk[brotli,compression,core]\" \"libcroco[core]\" \"libepoxy[core]\" \"libffi[core]\" \"libflac[core]\" \"libiconv[core]\" \"libjpeg-turbo[core]\" \"liblzma[core]\" \"libogg[core]\" \"libpng[core]\" \"librsvg[core]\" \"libsigcpp[core]\" \"libsigcpp-3[core]\" \"libsndfile[core,external-libs,mpeg]\" \"libvorbis[core]\" \"libwebp[core,libwebpmux,nearlossless,simd,unicode]\" \"libxml2[core]\" \"libxmlpp[core]\" \"lzo[core]\" \"mp3lame[core]\" \"mpg123[core]\" \"nlohmann-json[core]\" \"openblas[core]\" \"opencv[core,default-features]\" \"opencv4[core,default-features,dnn,jpeg,png,quirc,tiff,webp]\" \"openssl[core]\" \"opus[core]\" \"pango[core]\" \"pcre[core]\" \"pcre2[core]\" \"pixman[core]\" \"pkgconf[core]\" \"portaudio[core]\" \"portmidi[core]\" \"protobuf[core]\" \"pthread[core]\" \"pthreads[core]\" \"quirc[core]\" \"sdl2[core]\" \"tiff[core,jpeg,lzma,zip]\" \"yasm[core,tools]\" \"yasm-tool-helper[core]\" \"zlib[core]\" \"zstd[core]\""
pkgs: "\"aubio[core,tools]\" \"boost-algorithm[core]\" \"boost-align[core]\" \"boost-any[core]\" \"boost-array[core]\" \"boost-assert[core]\" \"boost-asio\" \"boost-atomic[core]\" \"boost-bind[core]\" \"boost-build[core]\" \"boost-chrono[core]\" \"boost-concept-check[core]\" \"boost-config[core]\" \"boost-container[core]\" \"boost-container-hash[core]\" \"boost-conversion[core]\" \"boost-core[core]\" \"boost-date-time[core]\" \"boost-detail[core]\" \"boost-dynamic-bitset[core]\" \"boost-exception[core]\" \"boost-function[core]\" \"boost-function-types[core]\" \"boost-fusion[core]\" \"boost-integer[core]\" \"boost-intrusive[core]\" \"boost-io[core]\" \"boost-iostreams[bzip2,core,lzma,zlib,zstd]\" \"boost-iterator[core]\" \"boost-lexical-cast[core]\" \"boost-locale[core]\" \"boost-move[core]\" \"boost-mp11[core]\" \"boost-mpl[core]\" \"boost-numeric-conversion[core]\" \"boost-optional[core]\" \"boost-predef[core]\" \"boost-preprocessor[core]\" \"boost-program-options[core]\" \"boost-random[core]\" \"boost-range[core]\" \"boost-ratio[core]\" \"boost-rational[core]\" \"boost-regex[core]\" \"boost-smart-ptr[core]\" \"boost-static-assert[core]\" \"boost-system[core]\" \"boost-thread[core]\" \"boost-throw-exception[core]\" \"boost-tokenizer[core]\" \"boost-tuple[core]\" \"boost-type-index[core]\" \"boost-type-traits[core]\" \"boost-typeof[core]\" \"boost-uninstall[core]\" \"boost-unordered[core]\" \"boost-utility[core]\" \"boost-variant2[core]\" \"boost-winapi[core]\" \"brotli[core]\" \"bzip2[core,tool]\" \"cairo[core,fontconfig,freetype,gobject]\" \"dirent[core]\" \"expat[core]\" \"ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]\" \"fftw3[core]\" \"fmt[core]\" \"fontconfig[core]\" \"freetype[brotli,bzip2,core,png,zlib]\" \"fribidi[core]\" \"gdk-pixbuf[core]\" \"getopt[core]\" \"getopt-win32[core]\" \"gettext[core,tools]\" \"glib[core]\" \"glibmm[core]\" \"glm[core]\" \"gperf[core]\" \"gtest[core]\" \"harfbuzz[core]\" \"icu[*]\" \"cpprestsdk[brotli,compression,core]\" \"libcroco[core]\" \"libepoxy[core]\" \"libffi[core]\" \"libflac[core]\" \"libiconv[core]\" \"libjpeg-turbo[core]\" \"liblzma[core]\" \"libogg[core]\" \"libpng[core]\" \"librsvg[core]\" \"libsigcpp[core]\" \"libsigcpp-3[core]\" \"libsndfile[core,external-libs,mpeg]\" \"libvorbis[core]\" \"libwebp[core,libwebpmux,nearlossless,simd,unicode]\" \"libxml2[core]\" \"libxmlpp[core]\" \"lzo[core]\" \"mp3lame[core]\" \"mpg123[core]\" \"nlohmann-json[core]\" \"openblas[core]\" \"opencv[core,default-features]\" \"opencv4[core,default-features,dnn,jpeg,png,quirc,tiff,webp]\" \"openssl[core]\" \"opus[core]\" \"pango[core]\" \"pcre[core]\" \"pcre2[core]\" \"pixman[core]\" \"pkgconf[core]\" \"portaudio[core]\" \"portmidi[core]\" \"protobuf[core]\" \"pthread[core]\" \"pthreads[core]\" \"quirc[core]\" \"sdl2[core]\" \"tiff[core,jpeg,lzma,zip]\" \"yasm[core,tools]\" \"yasm-tool-helper[core]\" \"zlib[core]\" \"zstd[core]\" \"spdlog[core]\""
triplet: x64-windows-release
extra-args: '--clean-after-build --overlay-triplets="${{ github.workspace }}\performous\cmake\triplets"'
cache-key: win64-vcpkg
Expand Down Expand Up @@ -156,6 +156,7 @@ jobs:
mingw-w64-x86_64-portaudio
mingw-w64-x86_64-portmidi
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-spdlog
mingw-w64-x86_64-winpthreads-git

- name: Run cmake to configure the project and build it
Expand Down
30 changes: 30 additions & 0 deletions cmake/Modules/FindSpdlog.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
include(LibFindMacros)
include(LibFetchMacros)

set(Spdlog_GIT_VERSION "v1.15.0")

if(SELF_BUILT_SPDLOG STREQUAL "ALWAYS")
message(STATUS "spdlog forced to build from source")
libfetch_git_pkg(Spdlog
REPOSITORY ${SELF_BUILT_GIT_BASE}/spdlog.git
REFERENCE ${Spdlog_GIT_VERSION}
OVERRIDE_FIND_PACKAGE
)
elseif(SELF_BUILT_SPDLOG STREQUAL "NEVER")
find_package(spdlog 1.12.0 REQUIRED PATHS /usr/lib PATH_SUFFIXES ${CMAKE_CXX_LIBRARY_ARCHITECTURE}/cmake/spdlog)
elseif(SELF_BUILT_SPDLOG STREQUAL "AUTO")
find_package(spdlog 1.12.0 PATHS /usr/lib PATH_SUFFIXES ${CMAKE_CXX_LIBRARY_ARCHITECTURE}/cmake/spdlog)
if(NOT spdlog_FOUND)
message(STATUS "spdlog build from source because not found on system")
libfetch_git_pkg(Spdlog
REPOSITORY ${SELF_BUILT_GIT_BASE}/spdlog.git
REFERENCE ${Spdlog_GIT_VERSION}
OVERRIDE_FIND_PACKAGE
)
else()
endif()
else()
message(FATAL_ERROR "unknown SELF_BUILT_SPDLOG value \"${SELF_BUILT_SPDLOG}\". Allowed values are NEVER, AUTO and ALWAYS")
endif()

message(STATUS "Found Spdlog ${Spdlog_VERSION}")
33 changes: 16 additions & 17 deletions docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,32 @@ COPY platform_flags.sh ./platform_flags.sh
## Install the deps and create the build directory
RUN <<EOR
#!/bin/bash -x
if [[ "${OS_VERSION}" == "10" ]]; then
touch /etc/SHOULD_USE_BACKPORTS
if [[ "${OS_VERSION}" == "11" ]]; then
. ./platform_flags.sh
apt-get update
apt-get install -y wget gpg
wget -nc https://apt.kitware.com/keys/kitware-archive-latest.asc
apt-key add kitware-archive-latest.asc
echo 'deb https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
echo 'deb http://deb.debian.org/debian buster-backports main' | tee /etc/apt/sources.list.d/backports.list
export_platform_flags '-DSELF_BUILT_AUBIO=ALWAYS -DSELF_BUILT_CED=ALWAYS -DSELF_BUILT_JSON=ALWAYS'
echo 'deb https://deb.debian.org/debian bullseye-backports main' | tee /etc/apt/sources.list.d/backports.list
export_platform_flags '-DSELF_BUILT_AUBIO=ALWAYS -DSELF_BUILT_CED=ALWAYS -DSELF_BUILT_JSON=ALWAYS -DSPDLOG_FMT_EXTERNAL_HO=ON -DSPDLOG_FMT_EXTERNAL=OFF'
echo 'export USE_BACKPORTS="-t bullseye-backports"' | tee /etc/SHOULD_USE_BACKPORTS
apt-get -y update
apt-get -y install libfmt-dev/buster-backports
apt-get -y install --no-install-recommends gnupg ca-certificates
echo 'deb https://ppa.launchpadcontent.net/litenstein/libfmt-performous-bkp/ubuntu focal main'| tee /etc/apt/sources.list.d/libfmt8.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E0A4B32AA748B9D11C4528301A509285F2EA337
apt-get -y update
apt-get install -y --no-install-recommends libfmt8/focal libfmt-dev/focal
fi
EOR

RUN <<EOR
#!/bin/bash -x
apt-get update
apt-get install -y --no-install-recommends git cmake build-essential \
gettext help2man libopenblas-dev libfftw3-dev libicu-dev libepoxy-dev \
. /etc/SHOULD_USE_BACKPORTS
apt-get -y update
apt-get install -y --no-install-recommends ${USE_BACKPORTS} git cmake cmake-data build-essential \
gcc g++ gettext help2man libopenblas-dev libfftw3-dev libicu-dev libepoxy-dev \
libsdl2-dev libfreetype6-dev libpango1.0-dev librsvg2-dev libxml++2.6-dev \
libavcodec-dev libavformat-dev libswscale-dev libjpeg-dev \
portaudio19-dev libglm-dev libboost-filesystem-dev \
libboost-iostreams-dev libboost-locale-dev libboost-system-dev \
libboost-program-options-dev libssl-dev libcpprest-dev \
libportmidi-dev libopencv-dev libaubio-dev nlohmann-json3-dev \
libfmt-dev ca-certificates file libgmock-dev libgtest-dev
apt-get clean
apt-get -y satisfy "libfmt-dev (>= 8)" "Conflicts: libspdlog-dev (<< 1.12)"
apt-get -y clean
mkdir -p /root/performous
EOR

Expand Down
11 changes: 9 additions & 2 deletions docker/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,27 @@ FROM docker.io/library/fedora:${OS_VERSION}

## Install the deps and create the working directory
## Enable the RPM Fusion Free Repo
ENV PLATFORM_CMAKE_FLAGS="-DUSE_BOOST_REGEX=1"
ENV PACKAGE_TYPE="RPM"

COPY platform_flags.sh ./platform_flags.sh

RUN <<EOR
#!/bin/bash -x
. ./platform_flags.sh
dnf install -y \
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf install -y git cmake gcc-c++ gettext cairo-devel librsvg2-devel libsigc++20-devel \
glibmm24-devel libxml++-devel boost-devel SDL2-devel libepoxy-devel ffmpeg-devel \
portaudio-devel help2man redhat-lsb opencv-devel portmidi-devel libjpeg-turbo-devel \
pango-devel glm-devel openblas-devel fftw-devel cpprest-devel \
aubio-devel json-devel rpm-build fmt-devel gtest-devel gmock-devel gtest
aubio-devel json-devel rpm-build fmt-devel gtest-devel gmock-devel gtest spdlog-devel
dnf clean all
if [[ "$(rpm -E %fedora)" == "39" ]]; then
dnf install -y clang
platform_flags="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
fi
export_platform_flags "${platform_flags}"
mkdir -p /root/performous
EOR

Expand Down
27 changes: 16 additions & 11 deletions docker/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,26 @@ ARG TZ="America/New_York"
ENV PACKAGE_TYPE="DEB"

## Install the deps and create the build directory
ADD https://apt.kitware.com/keys/kitware-archive-latest.asc ./key.asc
RUN <<EOR
#!/bin/bash -x
if [[ "${VERSION_ID}" == "20.04" ]]; then
. /etc/os-release
if [[ "${VERSION_ID}" == "20.04" || "${VERSION_ID}" == "22.04" ]]; then
apt-get -y update
apt-get -y install gnupg wget
wget -O ./key.asc https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null
apt-get -y install --no-install-recommends gnupg ca-certificates
gpg -v -o /usr/share/keyrings/kitware-archive-keyring.gpg --dearmor ./key.asc
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
if [[ "${VERSION_ID}" == "20.04" ]]; then
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
echo 'deb https://ppa.launchpadcontent.net/litenstein/libfmt-performous-bkp/ubuntu focal main'| tee /etc/apt/sources.list.d/libfmt8.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E0A4B32AA748B9D11C4528301A509285F2EA337
elif [[ "${VERSION_ID}" == "22.04" ]]; then
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
fi
apt-get -y update
apt-get -y install cmake
test -f /usr/share/doc/kitware-archive-keyring/copyright || rm /usr/share/keyrings/kitware-archive-keyring.gpg
apt-get install -y --no-install-recommends kitware-archive-keyring
fi
EOR

RUN <<EOR
#!/bin/bash -x
apt-get update
apt-get -y update
apt-get install -y --no-install-recommends git cmake build-essential \
gettext help2man libopenblas-dev libfftw3-dev libicu-dev libepoxy-dev \
libsdl2-dev libfreetype6-dev libpango1.0-dev librsvg2-dev libxml++2.6-dev \
Expand All @@ -34,7 +38,8 @@ RUN <<EOR
libboost-iostreams-dev libboost-locale-dev libboost-system-dev \
libboost-program-options-dev libssl-dev libcpprest-dev \
libportmidi-dev libopencv-dev libaubio-dev \
libfmt-dev ca-certificates file libgtest-dev libgmock-dev google-mock
ca-certificates file libgtest-dev libgmock-dev google-mock libspdlog-dev
apt-get -y satisfy "libfmt-dev (>= 8)" "Conflicts: libspdlog-dev (<< 1.12)"
apt-get clean
mkdir -p /root/performous
EOR
Expand Down
11 changes: 7 additions & 4 deletions game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ set(SELF_BUILT_AUBIO "AUTO" CACHE STRING "rule to allow self build of Aubio depe
set(SELF_BUILT_JSON "AUTO" CACHE STRING "rule to allow self build of Json dependency library [NEVER|AUTO*|ALWAYS]")
# This is AUTO cause CED is not available on ubuntu
set(SELF_BUILT_CED "AUTO" CACHE STRING "rule to allow self build of Ced dependency library [NEVER|AUTO*|ALWAYS]")
set(SELF_BUILT_SPDLOG "AUTO" CACHE STRING "rule to allow self build of Spdlog dependency library [NEVER|AUTO*|ALWAYS]")

set(Aubio_REQUIRED_VERSION "0.4.9")

Expand All @@ -114,22 +115,24 @@ set(Aubio_REQUIRED_VERSION "0.4.9")
if (MINGW)
target_link_libraries(performous PRIVATE mingw32)
endif()

foreach(lib ${OUR_LIBS} SDL2 PangoCairo LibRSVG LibXML++ AVFormat SWResample SWScale ZLIB JPEG PNG PortAudio Fontconfig GLM Json Ced Aubio)
foreach(lib SDL2 PangoCairo LibRSVG LibXML++ AVFormat SWResample SWScale ZLIB JPEG PNG PortAudio Fontconfig GLM Json Ced Aubio)
find_package(${lib} ${${lib}_REQUIRED_VERSION} REQUIRED)
message(STATUS "${lib} includes: ${${lib}_INCLUDE_DIRS}")
target_include_directories(performous SYSTEM PRIVATE ${${lib}_INCLUDE_DIRS})
target_link_libraries(performous PRIVATE ${${lib}_LIBRARIES})
add_definitions(${${lib}_DEFINITIONS})
endforeach(lib)

find_package(fmt REQUIRED CONFIG)
find_package(fmt 8.1 REQUIRED CONFIG)
# CppRESTSDK and their godforsaken U macro.
if(fmt_VERSION VERSION_GREATER_EQUAL 9.0.0)
target_compile_definitions(performous PRIVATE -D_TURN_OFF_PLATFORM_STRING)
endif()

target_link_libraries(performous PRIVATE fmt::fmt)
find_package(Spdlog REQUIRED MODULE)

target_compile_definitions(performous PRIVATE $<IF:$<NOT:$<BOOL:${SPDLOG_FMT_EXTERNAL_HO}>>,SPDLOG_FMT_EXTERNAL,SPDLOG_FMT_EXTERNAL_HO> FMT_USE_CONSTEXPR)
target_link_libraries(performous PRIVATE $<IF:$<NOT:$<BOOL:${SPDLOG_FMT_EXTERNAL_HO}>>,fmt::fmt,fmt::fmt-header-only> spdlog::spdlog_header_only)

# Activating MIDI hardware (e-drums with USB/MIDI connection)
set(ENABLE_MIDI AUTO CACHE STRING "Use midi hardware (e-drums with USB/MIDI connection)")
Expand Down
Loading
Loading