You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Patch the cmake function flatten_link_dependencies() in src/bin/CMakeLists.txt, skip target 'dl' just like the 'Threads::Threads' can fix it, actually cmake generate static library do not need link with libdl.a nore libdl.so
--- msquic-2.1.8-old/src/bin/CMakeLists.txt 2023-03-16 20:47:31
+++ msquic-2.1.8-new/src/bin/CMakeLists.txt 2023-12-07 11:07:30
@@ -57,12 +57,13 @@
if(NOT TARGET ${CURRENT_TARGET})
string(FIND ${CURRENT_TARGET} "$<LINK_ONLY:" LINK_ONLY)
string(FIND ${CURRENT_TARGET} "Threads::Threads" THREADS_TARGET)
+ string(FIND ${CURRENT_TARGET} "dl" DL_TARGET)
string(FIND ${CURRENT_TARGET} "${CMAKE_STATIC_LIBRARY_SUFFIX}" SUFFIX_INDEX)
if(${SUFFIX_INDEX} EQUAL "-1")
string(APPEND CURRENT_TARGET "${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
- if(${LINK_ONLY} EQUAL "-1" AND ${THREADS_TARGET} EQUAL "-1")
+ if(${LINK_ONLY} EQUAL "-1" AND ${THREADS_TARGET} EQUAL "-1" AND ${DL_TARGET} EQUAL "-1")
# This is expected to be a generator expression that maps
# to a static library
set_property(
Describe the bug
Try compile msquic as static library, it may failed by linking dl.a and file not found
Affected OS
Additional OS information
Docker image ubuntu:20.04
MsQuic version
v2.1
Steps taken to reproduce bug
Use FetchContent to introduce
Expected behavior
Generate libmsquic.a without any error
Actual outcome
Additional details
Compile on ubuntu 20.04 locally or cross compile with Android NDK r23.1 LTS, will all failed by linking dl.a
The text was updated successfully, but these errors were encountered: