set(LLVM_TARGET_DEFINITIONS ONNXToSpatial.td)
mlir_tablegen(ONNXToSpatial.hpp.inc -gen-rewriters "-I${ONNX_MLIR_SRC_ROOT}")
add_public_tablegen_target(ONNXToSpatialIncGen)

add_pim_library(OMONNXToSpatial
  Patterns/Math/Conv.cpp
  Patterns/Math/Gemm.cpp
  Patterns/Math/MatMul.cpp
  Patterns/NN/Pool.cpp
  Patterns/NN/Relu.cpp
  Patterns/Tensor/Concat.cpp
  Patterns/Tensor/Reshape.cpp
  ONNXToSpatialPass.cpp
  Common.cpp

  EXCLUDE_FROM_OM_LIBS

  DEPENDS
  ONNXToSpatialIncGen

  LINK_LIBS PUBLIC
  MLIRTosaDialect
  OMCompilerOptions
  OMPimCompilerOptions
  OMONNXOps
  SpatialOps
  OMPimCommon

  ACCEL_INCLUDE_DIRS PRIVATE
  ${PIM_GENERATED_INCLUDE_DIRS}
)
