From 96e3fb2416f6ce9bae94313b30bdfeeaddb2de36 Mon Sep 17 00:00:00 2001 From: Marius Brehler Date: Mon, 5 Jul 2021 15:01:12 +0000 Subject: [PATCH] [mlir] Unbreak building mlir-reduce Unbreaks building mlir-reduce when `DLLVM_INCLUDE_TESTS` is set to OFF. The dependency MLIRTestDialect is only available if building with tests. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D105434 --- mlir/tools/mlir-reduce/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mlir/tools/mlir-reduce/CMakeLists.txt b/mlir/tools/mlir-reduce/CMakeLists.txt index 63ccb94a7cc7..8893316f53b8 100644 --- a/mlir/tools/mlir-reduce/CMakeLists.txt +++ b/mlir/tools/mlir-reduce/CMakeLists.txt @@ -1,14 +1,20 @@ get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) +if(MLIR_INCLUDE_TESTS) + set(test_libs + MLIRTestDialect + ) +endif() + set(LIBS ${conversion_libs} ${dialect_libs} + ${test_libs} MLIRDialect MLIRIR MLIRPass MLIRReduceLib - MLIRTestDialect ) add_llvm_tool(mlir-reduce