[PATCH] D78773: Adjust libMLIR building to more closely follow libClang

Valentin Churavy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 16:52:47 PDT 2020


vchuravy created this revision.
Herald added subscribers: llvm-commits, Kayjukh, frgossen, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini, mgorny.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
vchuravy added reviewers: mehdi_amini, stephenneuendorffer.
vchuravy edited projects, added MLIR; removed LLVM.
Herald added a project: LLVM.
vchuravy added a parent revision: D78771: Add dependency edges between generated headers and users.
vchuravy added a reviewer: rriddle.

- 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`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78773

Files:
  mlir/cmake/modules/AddMLIR.cmake
  mlir/cmake/modules/MLIRConfig.cmake.in
  mlir/tools/mlir-shlib/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78773.259757.patch
Type: text/x-patch
Size: 4540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200423/7361341d/attachment.bin>


More information about the llvm-commits mailing list