[cmake] Fix tablegen exports
authorNikita Popov <npopov@redhat.com>
Tue, 16 Aug 2022 12:16:31 +0000 (14:16 +0200)
committerSylvestre Ledru <sylvestre@debian.org>
Tue, 16 Aug 2022 12:17:23 +0000 (14:17 +0200)
commit8f555a52e033ceec4c4508eb800c9a186acec87f
treedd6b47c869ed79697e3cdb61845a58f3b9fd9744
parent6f9423ef06926a70af84b77cb290c91214cf791a
[cmake] Fix tablegen exports

This fixes some fallout from D131282. Currently, add_tablegen() will add the tablegen target to LLVM_EXPORTS and associates the install with LLVMExports. For non-standalone builds, this means that you end up with mlir-tblgen and clang-tblgen in LLVMExports.

However, these projects should instead be using MLIR_EXPORTS/MLIRTargets and CLANG_EXPORTS/ClangTargets. To fix this, add an extra EXPORT option and make use of get_target_export_arg() to create the correct export argument.

Reviewed By: ashay-github

Differential Revision: https://reviews.llvm.org/D131565
clang/utils/TableGen/CMakeLists.txt
llvm/cmake/modules/TableGen.cmake
llvm/utils/TableGen/CMakeLists.txt
mlir/tools/mlir-pdll/CMakeLists.txt
mlir/tools/mlir-tblgen/CMakeLists.txt