[PATCH] D132799: Make sure libLLVM users link with libatomic if needed

Aaron Puchert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 15:02:47 PDT 2022


aaronpuchert updated this revision to Diff 459887.
aaronpuchert added a comment.

Go back to only adding libatomic. The `LLVM_SYSTEM_LIBS` contain many libraries that seem to be private dependencies only, and for now we don't properly track private vs public dependencies on component libraries.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132799/new/

https://reviews.llvm.org/D132799

Files:
  llvm/tools/llvm-shlib/CMakeLists.txt


Index: llvm/tools/llvm-shlib/CMakeLists.txt
===================================================================
--- llvm/tools/llvm-shlib/CMakeLists.txt
+++ llvm/tools/llvm-shlib/CMakeLists.txt
@@ -63,6 +63,10 @@
 
   target_link_libraries(LLVM PRIVATE ${LIB_NAMES})
 
+  if(LLVM_ENABLE_THREADS AND NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+    target_link_libraries(LLVM PUBLIC atomic)
+  endif()
+
   if (APPLE)
     set_property(TARGET LLVM APPEND_STRING PROPERTY
                 LINK_FLAGS


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132799.459887.patch
Type: text/x-patch
Size: 490 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220913/bf714c41/attachment.bin>


More information about the llvm-commits mailing list