Skip to content

Commit 6726ebe

Browse files
committed
add the C++ runtime to the packages to link to
gcc needs libstdc++ and clang needs libc++.
1 parent 1969946 commit 6726ebe

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,21 @@ else()
197197
endif()
198198

199199
if(NOT BUILD_FRAMEWORK)
200+
foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
201+
if (LIB MATCHES "-l.*")
202+
list(APPEND PKG_CXX_LIBS "${LIB}")
203+
else()
204+
list(APPEND PKG_CXX_LIBS "-l${LIB}")
205+
endif()
206+
endforeach()
207+
if(PKG_CXX_LIBS)
208+
# Blacklist for MinGW-w64
209+
list(REMOVE_ITEM PKG_CXX_LIBS
210+
"-lmingw32" "-lgcc_s" "-lgcc" "-lmoldname" "-lmingwex" "-lmingwthrd"
211+
"-lmsvcrt" "-lpthread" "-ladvapi32" "-lshell32" "-luser32" "-lkernel32")
212+
string(REPLACE ";" " " PKG_LIBS "${PKG_CXX_LIBS}")
213+
set(CHROMAPRINT_ADDITIONAL_LIBS "${CHROMAPRINT_ADDITIONAL_LIBS} ${PKG_LIBS}")
214+
endif()
200215
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libchromaprint.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libchromaprint.pc)
201216
install(
202217
FILES ${CMAKE_CURRENT_BINARY_DIR}/libchromaprint.pc

0 commit comments

Comments
 (0)