[Mlir-commits] [mlir] df2efd7 - Fix MLIR build with MLIR_INCLUDE_TESTS=OFF

Mehdi Amini llvmlistbot at llvm.org
Wed Aug 26 21:04:31 PDT 2020


Author: Ni Hui
Date: 2020-08-27T04:04:20Z
New Revision: df2efd770047ad75af7805e72dd853ae9510a27b

URL: https://github.com/llvm/llvm-project/commit/df2efd770047ad75af7805e72dd853ae9510a27b
DIFF: https://github.com/llvm/llvm-project/commit/df2efd770047ad75af7805e72dd853ae9510a27b.diff

LOG: Fix MLIR build with MLIR_INCLUDE_TESTS=OFF

error message

/usr/bin/ld: CMakeFiles/mlir-opt.dir/mlir-opt.cpp.o: in function `main':
mlir-opt.cpp:(.text.startup.main+0xb9): undefined reference to `mlir::registerTestDialect(mlir::DialectRegistry&)'

Reviewed By: mehdi_amini

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

Added: 
    

Modified: 
    mlir/tools/mlir-opt/mlir-opt.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp
index 6f27949d8329..ad76abed647e 100644
--- a/mlir/tools/mlir-opt/mlir-opt.cpp
+++ b/mlir/tools/mlir-opt/mlir-opt.cpp
@@ -133,7 +133,9 @@ int main(int argc, char **argv) {
 #endif
   DialectRegistry registry;
   registerAllDialects(registry);
+#ifdef MLIR_INCLUDE_TESTS
   registerTestDialect(registry);
+#endif
   return failed(MlirOptMain(argc, argv, "MLIR modular optimizer driver\n",
                             registry,
                             /*preloadDialectsInContext=*/false));


        


More information about the Mlir-commits mailing list