[Mlir-commits] [mlir] 177a0e5 - Fix running MLIR tests when enabling examples but the native backends isn't configured (NFC)

Mehdi Amini llvmlistbot at llvm.org
Tue Jan 24 20:38:29 PST 2023


Author: Mehdi Amini
Date: 2023-01-24T20:32:51-08:00
New Revision: 177a0e591662be8bd60ffbdff8f45f54428c2c1e

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

LOG: Fix running MLIR tests when enabling examples but the native backends isn't configured (NFC)

Added: 
    

Modified: 
    mlir/examples/toy/Ch6/CMakeLists.txt
    mlir/examples/toy/Ch7/CMakeLists.txt
    mlir/test/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/examples/toy/Ch6/CMakeLists.txt b/mlir/examples/toy/Ch6/CMakeLists.txt
index 48094f56d6512..13ab002ad6864 100644
--- a/mlir/examples/toy/Ch6/CMakeLists.txt
+++ b/mlir/examples/toy/Ch6/CMakeLists.txt
@@ -1,3 +1,9 @@
+# This chapter depends on JIT support enabled.
+if(NOT MLIR_ENABLE_EXECUTION_ENGINE)
+  return()
+endif()
+
+
 # For a better template to copy, see examples/standalone
 include_directories(include)
 add_subdirectory(include)

diff  --git a/mlir/examples/toy/Ch7/CMakeLists.txt b/mlir/examples/toy/Ch7/CMakeLists.txt
index 8de18d37e3d82..8c4c3ee06b572 100644
--- a/mlir/examples/toy/Ch7/CMakeLists.txt
+++ b/mlir/examples/toy/Ch7/CMakeLists.txt
@@ -1,3 +1,8 @@
+# This chapter depends on JIT support enabled.
+if(NOT MLIR_ENABLE_EXECUTION_ENGINE)
+  return()
+endif()
+
 # For a better template to copy, see examples/standalone
 include_directories(include)
 add_subdirectory(include)

diff  --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt
index 5b40591ef8d1a..8e17a24efc548 100644
--- a/mlir/test/CMakeLists.txt
+++ b/mlir/test/CMakeLists.txt
@@ -121,9 +121,13 @@ if(LLVM_BUILD_EXAMPLES)
     toyc-ch3
     toyc-ch4
     toyc-ch5
-    toyc-ch6
-    toyc-ch7
     )
+  if(MLIR_ENABLE_EXECUTION_ENGINE)
+    list(APPEND MLIR_TEST_DEPENDS
+      toyc-ch6
+      toyc-ch7
+    )
+  endif()
 endif()
 
 if(MLIR_ENABLE_SPIRV_CPU_RUNNER)


        


More information about the Mlir-commits mailing list