[clang] Avoid linking libdl unless needed

Differential Revision: https://reviews.llvm.org/D80492
This commit is contained in:
Tobias Hieta 2020-05-28 21:04:38 +03:00 committed by Martin Storsjö
parent 2b0c8546ac
commit 0073c293a4
1 changed files with 2 additions and 3 deletions

View File

@ -66,9 +66,8 @@ if (LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA)
endif ()
endif ()
find_library(DL_LIBRARY_PATH dl)
if (DL_LIBRARY_PATH)
list(APPEND LIBS dl)
if (HAVE_LIBDL)
list(APPEND LIBS ${CMAKE_DL_LIBS})
endif()
option(LIBCLANG_BUILD_STATIC