From 0bd31acab293c64da49b69e3f112fa82f01f2bf1 Mon Sep 17 00:00:00 2001 From: Hyperblast Date: Sun, 1 Feb 2026 06:32:26 +0500 Subject: [PATCH 1/4] fix building with system libraries --- CMakeLists.txt | 6 +++--- cpp/extlibs/catch/CMakeLists.txt | 2 +- cpp/extlibs/catch/system/FindCatch.cmake | 4 ++-- cpp/extlibs/nljson/system/FindNljson.cmake | 2 +- cpp/server/tests/base64_tests.cpp | 2 +- cpp/server/tests/fnv_hash_tests.cpp | 2 +- cpp/server/tests/parsing_tests.cpp | 2 +- cpp/server/tests/router_tests.cpp | 2 +- cpp/server/tests/runner.cpp | 2 +- cpp/server/tests/server_tests.cpp | 2 +- cpp/server/tests/string_utils_tests.cpp | 2 +- cpp/server/tests/timers_tests.cpp | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4ba2f93..8cd414d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,9 +35,9 @@ local_library_option(catch ENABLE_LOCAL_CATCH "ENABLE_TESTS") local_library_option(stringencoders ENABLE_LOCAL_STRINGENCODERS "") if(OS_POSIX) - if(NOT OS_MAC) - option(ENABLE_STATIC_STDLIB "Build with static libstdc++" OFF) - endif() + if(NOT OS_MAC) + option(ENABLE_STATIC_STDLIB "Build with static libstdc++" OFF) + endif() option(ENABLE_DEADBEEF "Build plugin for deadbeef player" ON) option( diff --git a/cpp/extlibs/catch/CMakeLists.txt b/cpp/extlibs/catch/CMakeLists.txt index bc1b08aa..3cd94c6c 100644 --- a/cpp/extlibs/catch/CMakeLists.txt +++ b/cpp/extlibs/catch/CMakeLists.txt @@ -14,7 +14,7 @@ ExternalProject_Add( CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND - ${CMAKE_COMMAND} -E copy_if_different ${EXTLIB_INSTALL_DIR}/include/catch.hpp + ${CMAKE_COMMAND} -E copy_if_different ${EXTLIB_INSTALL_DIR}/include/catch2/catch.hpp LOG_DOWNLOAD 0 LOG_UPDATE 0 LOG_CONFIGURE 0 LOG_BUILD 0 LOG_INSTALL 1 ) diff --git a/cpp/extlibs/catch/system/FindCatch.cmake b/cpp/extlibs/catch/system/FindCatch.cmake index 8302b70a..39b56d0b 100644 --- a/cpp/extlibs/catch/system/FindCatch.cmake +++ b/cpp/extlibs/catch/system/FindCatch.cmake @@ -1,7 +1,7 @@ find_path( CATCH_INCLUDE_DIRS - NAMES catch.hpp - DOC "catch include directory" + NAMES catch2/catch.hpp + DOC "catch2 include directory" ) include(FindPackageHandleStandardArgs) diff --git a/cpp/extlibs/nljson/system/FindNljson.cmake b/cpp/extlibs/nljson/system/FindNljson.cmake index ca06e92f..549de225 100644 --- a/cpp/extlibs/nljson/system/FindNljson.cmake +++ b/cpp/extlibs/nljson/system/FindNljson.cmake @@ -1,6 +1,6 @@ find_path( NLJSON_INCLUDE_DIRS - NAMES nlohmann/json.h + NAMES nlohmann/json.hpp DOC "nlohmann json include directory" ) diff --git a/cpp/server/tests/base64_tests.cpp b/cpp/server/tests/base64_tests.cpp index 515f0d45..b57a9816 100644 --- a/cpp/server/tests/base64_tests.cpp +++ b/cpp/server/tests/base64_tests.cpp @@ -1,6 +1,6 @@ #include "base64.hpp" -#include +#include namespace msrv { namespace base64_tests { diff --git a/cpp/server/tests/fnv_hash_tests.cpp b/cpp/server/tests/fnv_hash_tests.cpp index 46336149..b1b88657 100644 --- a/cpp/server/tests/fnv_hash_tests.cpp +++ b/cpp/server/tests/fnv_hash_tests.cpp @@ -1,6 +1,6 @@ #include "fnv_hash.hpp" -#include +#include namespace msrv { namespace fnv_hash_tests { diff --git a/cpp/server/tests/parsing_tests.cpp b/cpp/server/tests/parsing_tests.cpp index 0c5aa220..19bfe007 100644 --- a/cpp/server/tests/parsing_tests.cpp +++ b/cpp/server/tests/parsing_tests.cpp @@ -1,6 +1,6 @@ #include "parsing.hpp" -#include +#include namespace msrv { namespace base64_tests { diff --git a/cpp/server/tests/router_tests.cpp b/cpp/server/tests/router_tests.cpp index 24980253..d53f3560 100644 --- a/cpp/server/tests/router_tests.cpp +++ b/cpp/server/tests/router_tests.cpp @@ -1,6 +1,6 @@ #include "router.hpp" -#include +#include namespace msrv { namespace router_tests { diff --git a/cpp/server/tests/runner.cpp b/cpp/server/tests/runner.cpp index 09ef9404..3ecd3450 100644 --- a/cpp/server/tests/runner.cpp +++ b/cpp/server/tests/runner.cpp @@ -1,7 +1,7 @@ #include "test_main.hpp" #define CATCH_CONFIG_RUNNER -#include "catch.hpp" +#include namespace msrv { diff --git a/cpp/server/tests/server_tests.cpp b/cpp/server/tests/server_tests.cpp index a4db6630..e3400f49 100644 --- a/cpp/server/tests/server_tests.cpp +++ b/cpp/server/tests/server_tests.cpp @@ -5,7 +5,7 @@ #include "settings.hpp" #include "project_info.hpp" -#include +#include #include namespace msrv { diff --git a/cpp/server/tests/string_utils_tests.cpp b/cpp/server/tests/string_utils_tests.cpp index 132cb28d..15044321 100644 --- a/cpp/server/tests/string_utils_tests.cpp +++ b/cpp/server/tests/string_utils_tests.cpp @@ -1,6 +1,6 @@ #include "string_utils.hpp" -#include +#include namespace msrv::string_utils_tests { diff --git a/cpp/server/tests/timers_tests.cpp b/cpp/server/tests/timers_tests.cpp index 09647ee3..277682a6 100644 --- a/cpp/server/tests/timers_tests.cpp +++ b/cpp/server/tests/timers_tests.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include namespace msrv { namespace timers_tests { From 3a9bad7b593ece58e1c332eef44f75043241687b Mon Sep 17 00:00:00 2001 From: Hyperblast Date: Sun, 1 Feb 2026 06:55:44 +0500 Subject: [PATCH 2/4] fix cmake warnings --- CMakeLists.txt | 3 +++ cpp/extlibs/catch/system/FindCatch.cmake | 2 +- cpp/extlibs/deadbeef/system/FindDeadbeef.cmake | 2 +- cpp/extlibs/nljson/system/FindNljson.cmake | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cd414d8..0ff68e37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 3.24) +# Use cmake scripts provided by boost, not the cmake itself +cmake_policy(SET CMP0167 NEW) + project( beefweb VERSION 0.11 diff --git a/cpp/extlibs/catch/system/FindCatch.cmake b/cpp/extlibs/catch/system/FindCatch.cmake index 39b56d0b..7fa24768 100644 --- a/cpp/extlibs/catch/system/FindCatch.cmake +++ b/cpp/extlibs/catch/system/FindCatch.cmake @@ -7,7 +7,7 @@ find_path( include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - CATCH REQUIRED_VARS CATCH_INCLUDE_DIRS + Catch REQUIRED_VARS CATCH_INCLUDE_DIRS ) mark_as_advanced(CATCH_INCLUDE_DIRS) diff --git a/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake b/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake index 1deb8e45..dd861968 100644 --- a/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake +++ b/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake @@ -8,7 +8,7 @@ find_path( include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - DEADBEEF REQUIRED_VARS DEADBEEF_INCLUDE_DIRS + Deadbeef REQUIRED_VARS DEADBEEF_INCLUDE_DIRS ) mark_as_advanced(DEADBEEF_INCLUDE_DIRS) diff --git a/cpp/extlibs/nljson/system/FindNljson.cmake b/cpp/extlibs/nljson/system/FindNljson.cmake index 549de225..ce3bf0c0 100644 --- a/cpp/extlibs/nljson/system/FindNljson.cmake +++ b/cpp/extlibs/nljson/system/FindNljson.cmake @@ -7,7 +7,7 @@ find_path( include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - NLJSON REQUIRED_VARS NLJSON_INCLUDE_DIR + Nljson REQUIRED_VARS NLJSON_INCLUDE_DIRS ) mark_as_advanced(NLJSON_INCLUDE_DIRS) From 83f25b9fdd104cb0c8f6071fedf9b056b3f7ab72 Mon Sep 17 00:00:00 2001 From: Hyperblast Date: Sun, 1 Feb 2026 07:09:52 +0500 Subject: [PATCH 3/4] deadbeef: allow building without support for legacy artwork plugin --- cpp/extlibs/deadbeef/local/FindDeadbeef.cmake | 1 + cpp/extlibs/deadbeef/system/FindDeadbeef.cmake | 2 ++ cpp/server/deadbeef/CMakeLists.txt | 12 +++++++++++- cpp/server/deadbeef/artwork_fetcher.hpp | 3 +++ cpp/server/deadbeef/player_misc.cpp | 2 ++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cpp/extlibs/deadbeef/local/FindDeadbeef.cmake b/cpp/extlibs/deadbeef/local/FindDeadbeef.cmake index 3ac66387..c39faf0e 100644 --- a/cpp/extlibs/deadbeef/local/FindDeadbeef.cmake +++ b/cpp/extlibs/deadbeef/local/FindDeadbeef.cmake @@ -1 +1,2 @@ +set(DEADBEEF_ARTWORK_LEGACY ON) set(DEADBEEF_INCLUDE_DIRS ${EXTLIB_INSTALL_DIR}/include) diff --git a/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake b/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake index dd861968..f486d17b 100644 --- a/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake +++ b/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake @@ -1,3 +1,5 @@ +set(DEADBEEF_ARTWORK_LEGACY OFF) + find_path( DEADBEEF_INCLUDE_DIRS NAMES deadbeef/deadbeef.h diff --git a/cpp/server/deadbeef/CMakeLists.txt b/cpp/server/deadbeef/CMakeLists.txt index 3c426a50..5c287bdb 100644 --- a/cpp/server/deadbeef/CMakeLists.txt +++ b/cpp/server/deadbeef/CMakeLists.txt @@ -7,7 +7,7 @@ include_directories( set( PLUGIN_SOURCES add_items_scope.cpp add_items_scope.hpp - artwork_fetcher_v1.cpp artwork_fetcher_v2.cpp artwork_fetcher.hpp + artwork_fetcher_v2.cpp artwork_fetcher.hpp common.cpp common.hpp player.hpp player_control.cpp @@ -19,6 +19,16 @@ set( utils.cpp utils.hpp ) +if(DEADBEEF_ARTWORK_LEGACY) + add_definitions(-DDEADBEEF_ARTWORK_LEGACY) + + set( + PLUGIN_SOURCES + ${PLUGIN_SOURCES} + artwork_fetcher_v1.cpp + ) +endif() + add_library( deadbeef_plugin MODULE ${PLUGIN_SOURCES} diff --git a/cpp/server/deadbeef/artwork_fetcher.hpp b/cpp/server/deadbeef/artwork_fetcher.hpp index c35f32a1..5fd5280a 100644 --- a/cpp/server/deadbeef/artwork_fetcher.hpp +++ b/cpp/server/deadbeef/artwork_fetcher.hpp @@ -13,7 +13,10 @@ class ArtworkFetcher virtual boost::unique_future fetchArtwork(PlaylistPtr playlist, PlaylistItemPtr item) = 0; +#ifdef DEADBEEF_ARTWORK_LEGACY static std::unique_ptr createV1(); +#endif + static std::unique_ptr createV2(); }; diff --git a/cpp/server/deadbeef/player_misc.cpp b/cpp/server/deadbeef/player_misc.cpp index 2f02af52..b28df608 100644 --- a/cpp/server/deadbeef/player_misc.cpp +++ b/cpp/server/deadbeef/player_misc.cpp @@ -82,10 +82,12 @@ void PlayerImpl::connect() artworkFetcher_ = ArtworkFetcher::createV2(); +#ifdef DEADBEEF_ARTWORK_LEGACY if (!artworkFetcher_) { artworkFetcher_ = ArtworkFetcher::createV1(); } +#endif } void PlayerImpl::disconnect() From 3fdacd3a36b7e0fe3c635ec25724971272360785 Mon Sep 17 00:00:00 2001 From: Hyperblast Date: Sun, 1 Feb 2026 07:19:56 +0500 Subject: [PATCH 4/4] check cmake version before setting policy --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ff68e37..3cfbe617 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,9 @@ cmake_minimum_required(VERSION 3.24) # Use cmake scripts provided by boost, not the cmake itself -cmake_policy(SET CMP0167 NEW) +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30.0") + cmake_policy(SET CMP0167 NEW) +endif() project( beefweb