################################################################################
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
# runtime/src/iree/async/platform/js/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
    token_table
  HDRS
    "token_table.h"
  SRCS
    "token_table.c"
  DEPS
    iree::async
    iree::base
  PUBLIC
)

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

iree_wasm_cc_library(
  NAME
    proactor_imports_js
  SRCS
    "proactor_imports.mjs"
  MODULE
    "iree_proactor"
  PUBLIC
)

iree_cc_library(
  NAME
    proactor
  HDRS
    "proactor.h"
  SRCS
    "proactor.c"
  DEPS
    ::imports
    ::proactor_imports_js
    ::token_table
    iree::async
    iree::async::util::sequence_emulation
    iree::base
  PUBLIC
)

iree_cc_test(
  NAME
    token_table_test
  SRCS
    "token_table_test.cc"
  DEPS
    ::token_table
    iree::async
    iree::testing::gtest
    iree::testing::gtest_main
)

iree_cc_test(
  NAME
    proactor_test
  SRCS
    "proactor_test.cc"
  DEPS
    ::proactor
    iree::async
    iree::testing::gtest
    iree::testing::gtest_main
)

iree_wasm_entry(
  NAME
    main
  MAIN
    "proactor_worker_main.mjs"
  SRCS
    "proactor_event_host.mjs"
    "proactor_ring.mjs"
  PUBLIC
)

iree_wasm_entry(
  NAME
    inline_main
  MAIN
    "proactor_inline_main.mjs"
  SRCS

  PUBLIC
)

add_custom_command(OUTPUT proactor_test_runner_data.stamp
    COMMAND ${CMAKE_COMMAND} -E touch proactor_test_runner_data.stamp
  DEPENDS
    "proactor_event_host.mjs"
    "proactor_ring.mjs"
    "proactor_test_runner.mjs"
)

add_custom_target(proactor_test_runner_data
    DEPENDS proactor_test_runner_data.stamp
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
