[all-commits] [llvm/llvm-project] 438f80: [mlir] Configure mlir so that it can be directly i...

Stella Stamenova via All-commits all-commits at lists.llvm.org
Wed Jan 19 12:02:58 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 438f805145212a67d15b5950c4628298d65f7903
      https://github.com/llvm/llvm-project/commit/438f805145212a67d15b5950c4628298d65f7903
  Author: Stella Stamenova <stilis at microsoft.com>
  Date:   2022-01-19 (Wed, 19 Jan 2022)

  Changed paths:
    M mlir/cmake/modules/MLIRConfig.cmake.in

  Log Message:
  -----------
  [mlir] Configure mlir so that it can be directly included in a parent cmakelists.txt

The goal is to allow a project to directly include the `CMakeLists.txt` of mlir via something such as `add_directory`. This currently doesn't work because the exported targets then end up being imported in the same top-level project and `cmake` is not happy. LLVM works around this by guarding the exports based on the existence of the `LLVMSupport` library. This change does the same using `MLIRSupport`. In our experience, no targets need to be added to the export in the case.

If there's a preferred way of doing this or a better lib to use as the main target to check for, please let me know.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D117599




More information about the All-commits mailing list