Skip to content

Commit 7a77242

Browse files
committed
contrib: chromaprint: use CMAKE_CXX_IMPLICIT_LINK_LIBRARIES to get the C++ runtime
Submitted upstream acoustid/chromaprint#119
1 parent 8d5c081 commit 7a77242

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 6726ebef3eec9dcc9d08b2ad6ae352bacb215e5e Mon Sep 17 00:00:00 2001
2+
From: Steve Lhomme <[email protected]>
3+
Date: Mon, 5 Sep 2022 16:13:05 +0200
4+
Subject: [PATCH 2/2] add the C++ runtime to the packages to link to
5+
6+
gcc needs libstdc++ and clang needs libc++.
7+
---
8+
CMakeLists.txt | 15 +++++++++++++++
9+
1 file changed, 15 insertions(+)
10+
11+
diff --git a/CMakeLists.txt b/CMakeLists.txt
12+
index 0dbd9bd..67fa620 100644
13+
--- a/CMakeLists.txt
14+
+++ b/CMakeLists.txt
15+
@@ -197,6 +197,21 @@ else()
16+
endif()
17+
18+
if(NOT BUILD_FRAMEWORK)
19+
+ foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
20+
+ if (LIB MATCHES "-l.*")
21+
+ list(APPEND PKG_CXX_LIBS "${LIB}")
22+
+ else()
23+
+ list(APPEND PKG_CXX_LIBS "-l${LIB}")
24+
+ endif()
25+
+ endforeach()
26+
+ if(PKG_CXX_LIBS)
27+
+ # Blacklist for MinGW-w64
28+
+ list(REMOVE_ITEM PKG_CXX_LIBS
29+
+ "-lmingw32" "-lgcc_s" "-lgcc" "-lmoldname" "-lmingwex" "-lmingwthrd"
30+
+ "-lmsvcrt" "-lpthread" "-ladvapi32" "-lshell32" "-luser32" "-lkernel32")
31+
+ string(REPLACE ";" " " PKG_LIBS "${PKG_CXX_LIBS}")
32+
+ set(CHROMAPRINT_ADDITIONAL_LIBS "${CHROMAPRINT_ADDITIONAL_LIBS} ${PKG_LIBS}")
33+
+ endif()
34+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libchromaprint.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libchromaprint.pc)
35+
install(
36+
FILES ${CMAKE_CURRENT_BINARY_DIR}/libchromaprint.pc
37+
--
38+
2.27.0.windows.1
39+

contrib/src/chromaprint/rules.mak

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ $(TARBALLS)/chromaprint-$(CHROMAPRINT_VERSION).tar.gz:
1616
chromaprint: chromaprint-$(CHROMAPRINT_VERSION).tar.gz .sum-chromaprint
1717
$(UNPACK)
1818
$(APPLY) $(SRC)/chromaprint/linklibs.patch
19+
$(APPLY) $(SRC)/chromaprint/0002-add-the-C-runtime-to-the-packages-to-link-to.patch
1920
$(MOVE)
2021

2122
DEPS_chromaprint = ffmpeg $(DEPS_ffmpeg)

0 commit comments

Comments
 (0)