[clang] a41af6e - [clang] Fix libdl linking for libclang in standalone mode

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 23 14:11:56 PDT 2020


Author: Tobias Hieta
Date: 2020-07-24T00:10:22+03:00
New Revision: a41af6e41e6fcf3e7030feaf24057cbe8291b748

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

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

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

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 cfe-commits mailing list