Skip to content
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
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
cmake_minimum_required(VERSION 3.24)

# Use cmake scripts provided by boost, not the cmake itself
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30.0")
cmake_policy(SET CMP0167 NEW)
endif()

project(
beefweb
VERSION 0.11
Expand Down Expand Up @@ -35,9 +40,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(
Expand Down
2 changes: 1 addition & 1 deletion cpp/extlibs/catch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ExternalProject_Add(
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND
${CMAKE_COMMAND} -E copy_if_different <DOWNLOADED_FILE> ${EXTLIB_INSTALL_DIR}/include/catch.hpp
${CMAKE_COMMAND} -E copy_if_different <DOWNLOADED_FILE> ${EXTLIB_INSTALL_DIR}/include/catch2/catch.hpp
LOG_DOWNLOAD 0 LOG_UPDATE 0 LOG_CONFIGURE 0 LOG_BUILD 0 LOG_INSTALL 1
)

Expand Down
6 changes: 3 additions & 3 deletions cpp/extlibs/catch/system/FindCatch.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
find_path(
CATCH_INCLUDE_DIRS
NAMES catch.hpp
DOC "catch include directory"
NAMES catch2/catch.hpp
DOC "catch2 include directory"
)

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)
1 change: 1 addition & 0 deletions cpp/extlibs/deadbeef/local/FindDeadbeef.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(DEADBEEF_ARTWORK_LEGACY ON)
set(DEADBEEF_INCLUDE_DIRS ${EXTLIB_INSTALL_DIR}/include)
4 changes: 3 additions & 1 deletion cpp/extlibs/deadbeef/system/FindDeadbeef.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set(DEADBEEF_ARTWORK_LEGACY OFF)

find_path(
DEADBEEF_INCLUDE_DIRS
NAMES deadbeef/deadbeef.h
Expand All @@ -8,7 +10,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)
4 changes: 2 additions & 2 deletions cpp/extlibs/nljson/system/FindNljson.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
find_path(
NLJSON_INCLUDE_DIRS
NAMES nlohmann/json.h
NAMES nlohmann/json.hpp
DOC "nlohmann json include directory"
)

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)
12 changes: 11 additions & 1 deletion cpp/server/deadbeef/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down
3 changes: 3 additions & 0 deletions cpp/server/deadbeef/artwork_fetcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class ArtworkFetcher

virtual boost::unique_future<ArtworkResult> fetchArtwork(PlaylistPtr playlist, PlaylistItemPtr item) = 0;

#ifdef DEADBEEF_ARTWORK_LEGACY
static std::unique_ptr<ArtworkFetcher> createV1();
#endif

static std::unique_ptr<ArtworkFetcher> createV2();
};

Expand Down
2 changes: 2 additions & 0 deletions cpp/server/deadbeef/player_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ void PlayerImpl::connect()

artworkFetcher_ = ArtworkFetcher::createV2();

#ifdef DEADBEEF_ARTWORK_LEGACY
if (!artworkFetcher_)
{
artworkFetcher_ = ArtworkFetcher::createV1();
}
#endif
}

void PlayerImpl::disconnect()
Expand Down
2 changes: 1 addition & 1 deletion cpp/server/tests/base64_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "base64.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

namespace msrv {
namespace base64_tests {
Expand Down
2 changes: 1 addition & 1 deletion cpp/server/tests/fnv_hash_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "fnv_hash.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

namespace msrv {
namespace fnv_hash_tests {
Expand Down
2 changes: 1 addition & 1 deletion cpp/server/tests/parsing_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "parsing.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

namespace msrv {
namespace base64_tests {
Expand Down
2 changes: 1 addition & 1 deletion cpp/server/tests/router_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "router.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

namespace msrv {
namespace router_tests {
Expand Down
2 changes: 1 addition & 1 deletion cpp/server/tests/runner.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "test_main.hpp"

#define CATCH_CONFIG_RUNNER
#include "catch.hpp"
#include <catch2/catch.hpp>

namespace msrv {

Expand Down
2 changes: 1 addition & 1 deletion cpp/server/tests/server_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "settings.hpp"
#include "project_info.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>
#include <boost/thread/future.hpp>

namespace msrv {
Expand Down
2 changes: 1 addition & 1 deletion cpp/server/tests/string_utils_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "string_utils.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

namespace msrv::string_utils_tests {

Expand Down
2 changes: 1 addition & 1 deletion cpp/server/tests/timers_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <string>
#include <boost/optional/optional_io.hpp>
#include <catch.hpp>
#include <catch2/catch.hpp>

namespace msrv {
namespace timers_tests {
Expand Down