Skip to content

[cmake][mlir] Fix the build under the Xcode generator #101057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mlir/include/mlir/Dialect/Arith/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
13 changes: 13 additions & 0 deletions mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading