unittests: Fix build with LLVM_LINK_LLVM_DYLIB=ON
authorTom Stellard <tstellar@redhat.com>
Wed, 7 Jul 2021 02:46:21 +0000 (19:46 -0700)
committerTom Stellard <tstellar@redhat.com>
Wed, 7 Jul 2021 13:50:45 +0000 (06:50 -0700)
commit2e4ec3e5d6a3bf7f61bea6898286cba64be7b764
tree1a9948fddefce0ea48f7cf0f43febdca85bfbb13
parentfeef171f762aa205b5f993e127b364f501a4d002
unittests: Fix build with LLVM_LINK_LLVM_DYLIB=ON

The build system was linking the PluginsTests unittest against libLLVM.so
and LLVMAsmParser which was causing the test to fail with this error:

LLVM ERROR: inconsistency in registered CommandLine options

We need to add llvm libraries to LLVM_LINK_COMPONENTS so that
they are dropped from the linker arguments when linking with
LLVM_LINK_LLVM_DYLIB=ON

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D105523
llvm/unittests/Passes/CMakeLists.txt