Skip to content

Commit

Permalink
Compile static library may failed by linking dl.a (#4030)
Browse files Browse the repository at this point in the history
  • Loading branch information
st-jliu authored Dec 30, 2023
1 parent 6b592b7 commit c4a5a38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ else()
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(
Expand Down

0 comments on commit c4a5a38

Please sign in to comment.