[Polly] Support linking ScopPassManager against LLVM dylib
authorMichał Górny <mgorny@gentoo.org>
Wed, 5 Aug 2020 08:22:32 +0000 (10:22 +0200)
committerMichał Górny <mgorny@gentoo.org>
Fri, 7 Aug 2020 04:46:35 +0000 (06:46 +0200)
Link ScopPassManager to LLVM dylib target if LLVM_LINK_LLVM_DYLIB
is enabled.  This fixes build failures on systems where static LLVM
libraries are not installed.

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

polly/unittests/ScopPassManager/CMakeLists.txt

index ed3bbd6..8830014 100644 (file)
@@ -1,5 +1,7 @@
-llvm_map_components_to_libnames(llvm_libs Passes Core Analysis)
 add_polly_unittest(ScopPassManagerTests
   PassManagerTest.cpp
   )
-target_link_libraries(ScopPassManagerTests PRIVATE ${llvm_libs})
+if (NOT LLVM_LINK_LLVM_DYLIB)
+  llvm_map_components_to_libnames(llvm_libs Passes Core Analysis)
+  target_link_libraries(ScopPassManagerTests PRIVATE ${llvm_libs})
+endif()