################################################################################
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
# runtime/src/iree/vm/bytecode/isa/BUILD.bazel                                 #
#                                                                              #
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
# CMake-only content.                                                          #
#                                                                              #
# To disable autogeneration for this file entirely, delete this header.        #
################################################################################

iree_add_all_subdirs()

iree_genrule(
  NAME
    op_table_gen
  SRCS
    "${PROJECT_SOURCE_DIR}/build_tools/scripts/generate_vm_isa.py"
    "isa.json"
  OUTS
    op_table.h
  CMD
    "python3 $(rootpath //build_tools/scripts:generate_vm_isa.py) --schema $(rootpath isa.json) --op-table $(execpath op_table.h)"
)

iree_genrule(
  NAME
    encoding_table_gen
  SRCS
    "${PROJECT_SOURCE_DIR}/build_tools/scripts/generate_vm_isa.py"
    "isa.json"
  OUTS
    encoding_table.c
    encoding_table.h
  CMD
    "python3 $(rootpath //build_tools/scripts:generate_vm_isa.py) --schema $(rootpath isa.json) --encoding-table-header $(execpath encoding_table.h) --encoding-table-source $(execpath encoding_table.c)"
)

iree_cc_library(
  NAME
    isa
  HDRS
    "encoding_table.h"
    "isa.h"
    "op_table.h"
  SRCS
    "encoding_table.c"
  DEPS
    iree::base
    iree::base::internal::flatcc::parsing
    iree::schemas::bytecode_module_def_c_fbs
    iree::vm
  PUBLIC
)

iree_cc_test(
  NAME
    isa_test
  SRCS
    "isa_test.cc"
  DEPS
    ::isa
    iree::testing::gtest
    iree::testing::gtest_main
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
