[Mlir-commits] [mlir] [cmake][mlir] Fix the build under the Xcode generator (PR #101057)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jul 29 11:37:20 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-arith

Author: Jon Roelofs (jroelofs)

<details>
<summary>Changes</summary>

A couple extra dependencies are needed when using the Xcode generator, since these targets all emit the same two files.

---
Full diff: https://github.com/llvm/llvm-project/pull/101057.diff


2 Files Affected:

- (modified) mlir/include/mlir/Dialect/Arith/IR/CMakeLists.txt (+7) 
- (modified) mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt (+13) 


``````````diff
diff --git a/mlir/include/mlir/Dialect/Arith/IR/CMakeLists.txt b/mlir/include/mlir/Dialect/Arith/IR/CMakeLists.txt
index a2f24bdd94444..64f5cecf355ab 100644
--- a/mlir/include/mlir/Dialect/Arith/IR/CMakeLists.txt
+++ b/mlir/include/mlir/Dialect/Arith/IR/CMakeLists.txt
@@ -8,3 +8,10 @@ mlir_tablegen(ArithOpsAttributes.cpp.inc -gen-attrdef-defs
 add_mlir_dialect(ArithOps arith)
 add_mlir_doc(ArithOps ArithOps Dialects/ -gen-dialect-doc)
 add_mlir_interface(ArithOpsInterfaces)
+
+if(XCODE)
+  # The Xcode generator needs a dependency between these two, one way or
+  # another, since both targets generate the same file:
+  # tools/mlir/include/mlir/Dialect/Arith/IR/ArithOpsEnums.h.inc
+  add_dependencies(MLIRArithOpsInterfacesIncGen MLIRArithOpsIncGen)
+endif()
\ No newline at end of file
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt b/mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
index 289c0e4bbdaf6..f5d6ab0da20c7 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
+++ b/mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
@@ -46,6 +46,19 @@ add_dependencies(mlir-headers LinalgOdsGen)
 
 add_mlir_dialect(LinalgOps linalg)
 
+if(XCODE)
+  # The Xcode generator needs a dependency between these two, one way or
+  # another, since all three targets generate the same file:
+  # tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.td
+  add_dependencies(
+    MLIRLinalgOpsIncGen
+    MLIRLinalgNamedStructuredOpsYamlIncGen
+    MLIRLinalgOpsEnumsIncGen)
+  add_dependencies(
+    MLIRLinalgNamedStructuredOpsYamlIncGen
+    MLIRLinalgOpsEnumsIncGen)
+endif()
+
 set(LLVM_TARGET_DEFINITIONS LinalgEnums.td)
 mlir_tablegen(LinalgOpsEnums.h.inc -gen-enum-decls)
 mlir_tablegen(LinalgOpsEnums.cpp.inc -gen-enum-defs)

``````````

</details>


https://github.com/llvm/llvm-project/pull/101057


More information about the Mlir-commits mailing list