Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mlir out of tree build #82

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tests/minimal_mlir_dialect_cmake.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test minimal cmake MLIR project
# REQUIRES: mlir-translate
# RUN: rm -rf %t
# RUN: mkdir -p %t/_build
# RUN: cat %s > %t/CMakeLists.txt
# RUN: cd %t/_build && %cmake .. -DMLIR_DIR=`%llvm-config --libdir`/cmake/mlir -DLLVM_DIR=`%llvm-config --libdir`/cmake/llvm && cmake --build .

cmake_minimum_required(VERSION 3.18.0)
project(mlir_out_of_tree)

find_package(MLIR REQUIRED CONFIG)

list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")

include(TableGen)
include(AddLLVM)
include(AddMLIR)
include(HandleLLVMOptions)
include(MLIRDetectPythonEnv)

add_mlir_aggregate(aggregator
SHARED
EMBED_LIBS
MLIRCAPIIR
MLIRCAPIRegistration
)