################################################################################
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
# runtime/src/iree/hal/drivers/webgpu/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_cc_library(
  NAME
    webgpu
  HDRS
    "api.h"
  SRCS
    "webgpu_driver.c"
    "webgpu_driver.h"
  DEPS
    ::handle_table
    ::webgpu_device
    ::webgpu_imports
    ::webgpu_imports_js
    iree::async
    iree::async::platform::js::proactor
    iree::async::util::proactor_pool
    iree::base
    iree::hal
  PUBLIC
)

iree_wasm_cc_library(
  NAME
    webgpu_imports_js
  SRCS
    "webgpu_imports.mjs"
  MODULE
    "iree_webgpu"
  PUBLIC
)

iree_cc_library(
  NAME
    handle_table
  HDRS
    "handle_table.h"
  SRCS
    "handle_table.c"
  DEPS
    iree::base
  PUBLIC
)

iree_cc_test(
  NAME
    handle_table_test
  SRCS
    "handle_table_test.cc"
  DEPS
    ::handle_table
    iree::testing::gtest
    iree::testing::gtest_main
)

iree_cc_library(
  NAME
    webgpu_imports
  HDRS
    "webgpu_imports.h"
  DEPS
    iree::base
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_allocator
  HDRS
    "webgpu_allocator.h"
  SRCS
    "webgpu_allocator.c"
  DEPS
    ::handle_table
    ::webgpu_buffer
    ::webgpu_imports
    iree::base
    iree::hal
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_buffer
  HDRS
    "webgpu_buffer.h"
  SRCS
    "webgpu_buffer.c"
  DEPS
    ::handle_table
    ::webgpu_constants
    ::webgpu_imports
    iree::base
    iree::hal
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_builder
  HDRS
    "webgpu_builder.h"
  SRCS
    "webgpu_builder.c"
  DEPS
    ::handle_table
    ::webgpu_buffer
    ::webgpu_isa
    iree::base
    iree::base::internal::arena
    iree::hal
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_builtins
  HDRS
    "webgpu_builtins.h"
  SRCS
    "webgpu_builtins.c"
  DEPS
    ::handle_table
    ::webgpu_constants
    ::webgpu_imports
    ::webgpu_isa
    iree::base
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_command_buffer
  HDRS
    "webgpu_command_buffer.h"
  SRCS
    "webgpu_command_buffer.c"
  DEPS
    ::handle_table
    ::webgpu_buffer
    ::webgpu_builder
    ::webgpu_builtins
    ::webgpu_executable
    ::webgpu_imports
    iree::base
    iree::hal
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_constants
  HDRS
    "webgpu.h"
  DEPS

  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_device
  HDRS
    "webgpu_device.h"
  SRCS
    "webgpu_device.c"
  DEPS
    ::handle_table
    ::webgpu_allocator
    ::webgpu_builtins
    ::webgpu_command_buffer
    ::webgpu_executable_cache
    ::webgpu_fd_file
    ::webgpu_imports
    ::webgpu_queue
    ::webgpu_semaphore
    iree::async
    iree::async::util::proactor_pool
    iree::base
    iree::hal
    iree::hal::utils::files
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_fd_file
  HDRS
    "webgpu_fd_file.h"
  SRCS
    "webgpu_fd_file.c"
  DEPS
    iree::base
    iree::hal
    iree::io::file_handle
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_queue
  HDRS
    "webgpu_queue.h"
  SRCS
    "webgpu_queue.c"
  DEPS
    ::handle_table
    ::webgpu_buffer
    ::webgpu_builder
    ::webgpu_builtins
    ::webgpu_command_buffer
    ::webgpu_constants
    ::webgpu_executable
    ::webgpu_fd_file
    ::webgpu_imports
    ::webgpu_semaphore
    iree::async
    iree::async::platform::js::proactor
    iree::base
    iree::base::internal::arena
    iree::hal
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_executable
  HDRS
    "webgpu_executable.h"
  SRCS
    "webgpu_executable.c"
  DEPS
    ::handle_table
    ::webgpu_imports
    iree::base
    iree::base::internal::flatcc::parsing
    iree::hal
    iree::hal::utils::executable_header
    iree::schemas::executable_debug_info_c_fbs
    iree::schemas::webgpu_executable_def_c_fbs
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_executable_cache
  HDRS
    "webgpu_executable_cache.h"
  SRCS
    "webgpu_executable_cache.c"
  DEPS
    ::handle_table
    ::webgpu_executable
    iree::base
    iree::hal
  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_isa
  HDRS
    "webgpu_isa.h"
  DEPS

  PUBLIC
)

iree_cc_library(
  NAME
    webgpu_semaphore
  HDRS
    "webgpu_semaphore.h"
  SRCS
    "webgpu_semaphore.c"
  DEPS
    ::webgpu_imports
    iree::async
    iree::base
    iree::hal
  PUBLIC
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
