[PATCH] D74588: Make TableGenGlobalISel an object library
Aaron Puchert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 31 16:12:41 PDT 2021
aaronpuchert added a comment.
It seems that everything is fine with `ninja`, but with `make` we're running into this fun hack:
macro(add_tablegen target project)
# ...
# CMake doesn't let compilation units depend on their dependent libraries on some generators.
if(NOT CMAKE_GENERATOR STREQUAL "Ninja" AND NOT XCODE)
# FIXME: It leaks to user, callee of add_tablegen.
set(LLVM_ENABLE_OBJLIB ON)
endif()
The source list of `llvm-tblgen` is then as expected `$<TARGET_OBJECTS:obj.llvm-tblgen>`, while the source list of `obj.llvm-tblgen` is `AsmMatcherEmitter.cpp;...;CTagsEmitter.cpp;$<TARGET_OBJECTS:obj.LLVMTableGenGlobalISel>;...`, and the objects from `obj.LLVMTableGenGlobalISel` are missing from the linker command. Apparently it's not possible to nest object libraries this way?
@beanz, I'm currently playing around with `target_link_libraries` for the object library since that seems to be supported <https://cmake.org/cmake/help/v3.13/command/target_link_libraries.html#linking-object-libraries> now, but perhaps you already know why this won't work?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74588/new/
https://reviews.llvm.org/D74588
More information about the llvm-commits
mailing list