Skip to content

Commit

Permalink
[Polly] Don't redundantly link libPolly into unittests.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Meinersbur committed Aug 24, 2021
1 parent 039b469 commit cdbc86d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion polly/unittests/CMakeLists.txt
Expand Up @@ -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)
Expand Down

0 comments on commit cdbc86d

Please sign in to comment.