[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.
This commit is contained in:
Michael Kruse 2021-08-24 02:49:06 -05:00
parent 039b469b85
commit cdbc86dd22
1 changed files with 7 additions and 1 deletions

View File

@ -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)