[mlir] Unbreak building mlir-reduce
authorMarius Brehler <marius.brehler@iml.fraunhofer.de>
Mon, 5 Jul 2021 15:01:12 +0000 (15:01 +0000)
committerMarius Brehler <marius.brehler@iml.fraunhofer.de>
Mon, 5 Jul 2021 15:08:53 +0000 (17:08 +0200)
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

index 63ccb94..8893316 100644 (file)
@@ -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