Skip to content

Commit c58f7c4

Browse files
authored
Fix building with system libraries (#348)
1 parent ff7b1fc commit c58f7c4

File tree

17 files changed

+42
-19
lines changed

17 files changed

+42
-19
lines changed

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
cmake_minimum_required(VERSION 3.24)
22

3+
# Use cmake scripts provided by boost, not the cmake itself
4+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30.0")
5+
cmake_policy(SET CMP0167 NEW)
6+
endif()
7+
38
project(
49
beefweb
510
VERSION 0.11
@@ -35,9 +40,9 @@ local_library_option(catch ENABLE_LOCAL_CATCH "ENABLE_TESTS")
3540
local_library_option(stringencoders ENABLE_LOCAL_STRINGENCODERS "")
3641

3742
if(OS_POSIX)
38-
if(NOT OS_MAC)
39-
option(ENABLE_STATIC_STDLIB "Build with static libstdc++" OFF)
40-
endif()
43+
if(NOT OS_MAC)
44+
option(ENABLE_STATIC_STDLIB "Build with static libstdc++" OFF)
45+
endif()
4146

4247
option(ENABLE_DEADBEEF "Build plugin for deadbeef player" ON)
4348
option(

cpp/extlibs/catch/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ExternalProject_Add(
1414
CONFIGURE_COMMAND ""
1515
BUILD_COMMAND ""
1616
INSTALL_COMMAND
17-
${CMAKE_COMMAND} -E copy_if_different <DOWNLOADED_FILE> ${EXTLIB_INSTALL_DIR}/include/catch.hpp
17+
${CMAKE_COMMAND} -E copy_if_different <DOWNLOADED_FILE> ${EXTLIB_INSTALL_DIR}/include/catch2/catch.hpp
1818
LOG_DOWNLOAD 0 LOG_UPDATE 0 LOG_CONFIGURE 0 LOG_BUILD 0 LOG_INSTALL 1
1919
)
2020

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
find_path(
22
CATCH_INCLUDE_DIRS
3-
NAMES catch.hpp
4-
DOC "catch include directory"
3+
NAMES catch2/catch.hpp
4+
DOC "catch2 include directory"
55
)
66

77
include(FindPackageHandleStandardArgs)
88

99
find_package_handle_standard_args(
10-
CATCH REQUIRED_VARS CATCH_INCLUDE_DIRS
10+
Catch REQUIRED_VARS CATCH_INCLUDE_DIRS
1111
)
1212

1313
mark_as_advanced(CATCH_INCLUDE_DIRS)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
set(DEADBEEF_ARTWORK_LEGACY ON)
12
set(DEADBEEF_INCLUDE_DIRS ${EXTLIB_INSTALL_DIR}/include)

cpp/extlibs/deadbeef/system/FindDeadbeef.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
set(DEADBEEF_ARTWORK_LEGACY OFF)
2+
13
find_path(
24
DEADBEEF_INCLUDE_DIRS
35
NAMES deadbeef/deadbeef.h
@@ -8,7 +10,7 @@ find_path(
810
include(FindPackageHandleStandardArgs)
911

1012
find_package_handle_standard_args(
11-
DEADBEEF REQUIRED_VARS DEADBEEF_INCLUDE_DIRS
13+
Deadbeef REQUIRED_VARS DEADBEEF_INCLUDE_DIRS
1214
)
1315

1416
mark_as_advanced(DEADBEEF_INCLUDE_DIRS)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
find_path(
22
NLJSON_INCLUDE_DIRS
3-
NAMES nlohmann/json.h
3+
NAMES nlohmann/json.hpp
44
DOC "nlohmann json include directory"
55
)
66

77
include(FindPackageHandleStandardArgs)
88

99
find_package_handle_standard_args(
10-
NLJSON REQUIRED_VARS NLJSON_INCLUDE_DIR
10+
Nljson REQUIRED_VARS NLJSON_INCLUDE_DIRS
1111
)
1212

1313
mark_as_advanced(NLJSON_INCLUDE_DIRS)

cpp/server/deadbeef/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include_directories(
77
set(
88
PLUGIN_SOURCES
99
add_items_scope.cpp add_items_scope.hpp
10-
artwork_fetcher_v1.cpp artwork_fetcher_v2.cpp artwork_fetcher.hpp
10+
artwork_fetcher_v2.cpp artwork_fetcher.hpp
1111
common.cpp common.hpp
1212
player.hpp
1313
player_control.cpp
@@ -19,6 +19,16 @@ set(
1919
utils.cpp utils.hpp
2020
)
2121

22+
if(DEADBEEF_ARTWORK_LEGACY)
23+
add_definitions(-DDEADBEEF_ARTWORK_LEGACY)
24+
25+
set(
26+
PLUGIN_SOURCES
27+
${PLUGIN_SOURCES}
28+
artwork_fetcher_v1.cpp
29+
)
30+
endif()
31+
2232
add_library(
2333
deadbeef_plugin MODULE
2434
${PLUGIN_SOURCES}

cpp/server/deadbeef/artwork_fetcher.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ class ArtworkFetcher
1313

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

16+
#ifdef DEADBEEF_ARTWORK_LEGACY
1617
static std::unique_ptr<ArtworkFetcher> createV1();
18+
#endif
19+
1720
static std::unique_ptr<ArtworkFetcher> createV2();
1821
};
1922

cpp/server/deadbeef/player_misc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ void PlayerImpl::connect()
8282

8383
artworkFetcher_ = ArtworkFetcher::createV2();
8484

85+
#ifdef DEADBEEF_ARTWORK_LEGACY
8586
if (!artworkFetcher_)
8687
{
8788
artworkFetcher_ = ArtworkFetcher::createV1();
8889
}
90+
#endif
8991
}
9092

9193
void PlayerImpl::disconnect()

cpp/server/tests/base64_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "base64.hpp"
22

3-
#include <catch.hpp>
3+
#include <catch2/catch.hpp>
44

55
namespace msrv {
66
namespace base64_tests {

0 commit comments

Comments
 (0)