- Exports MLIR targets to be used out-of-tree.
- mimicks add_clang_library and add_flang_library.
- Fixes libMLIR.so
After https://reviews.llvm.org/D77515 libMLIR.so was no longer containing
any object files. We originally had a cludge there that made it work with
the static initalizers and when switchting away from that to the way the
clang shlib does it, I noticed that MLIR doesn't create a obj.{name} target,
and doesn't export it's targets to lib/cmake/mlir.
This is due to MLIR using add_llvm_library under the hood, which adds
the target to llvmexports.
Depends on D78771
I think dependency problem is solved if you change INTERFACE to PUBLIC here.