[polly] cdbc86d - [Polly] Don't redundantly link libPolly into unittests.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 24 01:08:36 PDT 2021


Author: Michael Kruse
Date: 2021-08-24T03:07:30-05:00
New Revision: cdbc86dd225063beb9fc8f6ba1f09afc18435331

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

LOG: [Polly] Don't redundantly link libPolly into unittests.

With LLVM_LINK_LLVM_DYLIB and LLVM_POLLY_LINK_INTO_TOOLS, Polly is
already linked into libLLVM.so, linking libPolly.a as well into
unittests results in duplicate command line registration errors.

Added: 
    

Modified: 
    polly/unittests/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/polly/unittests/CMakeLists.txt b/polly/unittests/CMakeLists.txt
index fac70383de948..94b75449c3022 100644
--- a/polly/unittests/CMakeLists.txt
+++ b/polly/unittests/CMakeLists.txt
@@ -16,7 +16,13 @@ function(add_polly_unittest test_name)
 
     set_property(TARGET ${test_name} PROPERTY FOLDER "Polly")
   endif()
-  target_link_libraries(${test_name} PRIVATE Polly)
+
+  if(LLVM_LINK_LLVM_DYLIB AND LLVM_POLLY_LINK_INTO_TOOLS)
+    # In this case Polly is already present in libLLVM,
+    # no need to link it again.
+  else()
+    target_link_libraries(${test_name} PRIVATE Polly)
+  endif()
 endfunction()
 
 add_subdirectory(Isl)


        


More information about the llvm-commits mailing list