Make TableGenGlobalISel an object library
authorAaron Puchert <aaronpuchert@alice-dsl.net>
Sat, 5 Jun 2021 13:04:18 +0000 (15:04 +0200)
committerAaron Puchert <aaronpuchert@alice-dsl.net>
Sat, 5 Jun 2021 13:04:33 +0000 (15:04 +0200)
commitdc1e7b73b81811b74a4fbde4c5cfab5a3ea7f820
tree91e148514f9522f3b68e72010bac1890083fa228
parentfbe4c839e8a2c849bc604ec3c6c03efb01482fb4
Make TableGenGlobalISel an object library

That's how it was originally intended but that wasn't possible because
we still needed to support older CMake versions.

The problem here is that the sources in TableGenGlobalISel are meant to
be linked into both llvm-tblgen and TableGenTests (a unit test), but not
be part of LLVM proper. So they shouldn't be an ordinary LLVM component.
Because they are used in llvm-tblgen, they can't draw in the LLVM dylib
dependency, but then we'd have to do the same thing in TableGenTests to
make sure we don't link both a static Support library and another copy
through the LLVM dylib.

With an object library we're just reusing the object files and don't
have to care about dependencies at all.

Differential Revision: https://reviews.llvm.org/D74588
llvm/unittests/TableGen/CMakeLists.txt