[MLIR] [CMake] Support building MLIR standalone
authorMichał Górny <mgorny@moritz.systems>
Tue, 2 Feb 2021 19:09:45 +0000 (13:09 -0600)
committerIsuru Fernando <isuruf@gmail.com>
Tue, 2 Feb 2021 19:10:21 +0000 (13:10 -0600)
commit2aa1af9b1da0d832270d9b8afcba19a4aba2c366
tree7024ef26ff03a215728e13b614bb3cb8374fdd0a
parent5b3881691f3375344c1b4c3d594b5958948851d7
[MLIR] [CMake] Support building MLIR standalone

Add the necessary bits to CMakeLists to make it possible to configure
MLIR against installed LLVM, and build it with minimal need for LLVM
source tree.  The latter is only necessary to run unittests, and if it
is missing then unittests are skipped with a warning.

This change includes the necessary changes to tests, in particular
adding some missing substitutions and defining missing variables
for lit.site.cfg.py substitution.

Reviewed By: stephenneuendorffer

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

Co-authored-by: Isuru Fernando <isuruf@gmail.com>
mlir/CMakeLists.txt
mlir/cmake/modules/AddMLIR.cmake
mlir/test/CMakeLists.txt
mlir/test/lit.cfg.py