# SPDX-License-Identifier: GPL-3.0-only
# ESP-IDF component wrapper for the Layer 1 engine.
#
# The repository root is the component directory. An ESP-IDF project can add
# it with EXTRA_COMPONENT_DIRS and include "rt_core.h":
#
#   set(EXTRA_COMPONENT_DIRS "/path/to/esp32s3-llm-runtime")
#
# Layer 2 (LlmRuntime / LlmService) stays Arduino-only. A native application
# uses the same validated engine through rt_core, the tokenizer wrappers and
# the model loader. The host build in host/ is unchanged.

idf_component_register(
    SRCS
        "src/core/llm.c"
        "src/core/model_lib.c"
        "src/core/moe.c"
        "src/core/kv_cache.c"
        "src/core/tokenizer.c"
        "src/core/dot_s8.S"
        "src/rt_core.c"
        "src/rt_manifest.c"
        "src/rt_envelope.c"
        "src/rt_plan.c"
        "src/platform/rt_platform_espidf.c"
    INCLUDE_DIRS
        "src"
        "src/core"
        "src/platform"
    PRIV_REQUIRES
        esp_partition
        sdmmc
        fatfs
        mbedtls
        esp_timer
        esp_rom
        esp_hw_support
        heap
        log
)
