[llvm] dc1e7b7 - Make TableGenGlobalISel an object library

Aaron Puchert via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 5 06:05:13 PDT 2021


Author: Aaron Puchert
Date: 2021-06-05T15:04:33+02:00
New Revision: dc1e7b73b81811b74a4fbde4c5cfab5a3ea7f820

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

LOG: 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

Added: 
    

Modified: 
    llvm/unittests/TableGen/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/TableGen/CMakeLists.txt b/llvm/unittests/TableGen/CMakeLists.txt
index 178018ba89674..15f60800aa9c5 100644
--- a/llvm/unittests/TableGen/CMakeLists.txt
+++ b/llvm/unittests/TableGen/CMakeLists.txt
@@ -9,7 +9,7 @@ tablegen(LLVM AutomataTables.inc -gen-searchable-tables)
 tablegen(LLVM AutomataAutomata.inc -gen-automata)
 add_public_tablegen_target(AutomataTestTableGen)
 
-add_llvm_unittest(TableGenTests
+add_llvm_unittest(TableGenTests DISABLE_LLVM_LINK_LLVM_DYLIB
   CodeExpanderTest.cpp
   AutomataTest.cpp
   )


        


More information about the llvm-commits mailing list