Alex Zinenko e2b19ef6ac [mlir] mark libraries in mlir/examples as such
LLVM build system separates between `add_llvm_example_library` and
`add_llvm_library`, which is presumably used to package examples
separately from the regular library. Introduce a similar approach to
building example libraries in MLIR and use it for the transform dialect
tutorial.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D153265
2023-06-20 13:02:42 +02:00

23 lines
583 B
CMake

# Outside examples, this should be `add_mlir_library`.
add_mlir_example_library(
# Library called MyExtension.
MyExtensionCh2
# Built from the following source files.
MyExtension.cpp
# Make includes visible without top-level path.
ADDITIONAL_HEADER_DIRS
${PROJECT_SOURCE_DIR}/examples/transform/Ch2/include
# Make sure ODS declaration and definitions are generated before compiling this.
DEPENDS
MyExtensionCh2IncGen
# Link in the transform dialect, an all generated dialects.
LINK_LIBS PRIVATE
MLIRTransformDialect
MLIRFuncDialect
MLIRSCFDialect
)