[llvm-branch-commits] [clang] 833f8c9 - [clang] Fix libdl linking for libclang in standalone mode

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 24 02:50:28 PDT 2020


Author: Tobias Hieta
Date: 2020-07-24T11:44:55+02:00
New Revision: 833f8c958601bb640ba6a25d627c1dc58dad14d2

URL: https://github.com/llvm/llvm-project/commit/833f8c958601bb640ba6a25d627c1dc58dad14d2
DIFF: https://github.com/llvm/llvm-project/commit/833f8c958601bb640ba6a25d627c1dc58dad14d2.diff

LOG: [clang] Fix libdl linking for libclang in standalone mode

Differential Revision: https://reviews.llvm.org/D81385

(cherry picked from commit a41af6e41e6fcf3e7030feaf24057cbe8291b748)

Added: 
    

Modified: 
    clang/tools/libclang/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
index 9b34682cc49b..a4077140acee 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -68,7 +68,12 @@ endif ()
 
 if (HAVE_LIBDL)
   list(APPEND LIBS ${CMAKE_DL_LIBS})
-endif()
+elseif (CLANG_BUILT_STANDALONE)
+  find_library(DL_LIBRARY_PATH dl)
+  if (DL_LIBRARY_PATH)
+    list(APPEND LIBS dl)
+  endif ()
+endif ()
 
 option(LIBCLANG_BUILD_STATIC
   "Build libclang as a static library (in addition to a shared one)" OFF)


        


More information about the llvm-branch-commits mailing list