idf_component_register(
    SRCS
        "desklock_main.c"
        "face.c"
        "audio.c"
        "net.c"
        "gw_client.c"
        "c6_ota.c"
        "wifi_diag.c"
        "fonts/font_face_140.c"
        "fonts/font_rain_22.c"
        "fonts/font_rage_64.c"
        "fonts/font_phosphor_64.c"
    INCLUDE_DIRS "."
    EMBED_FILES "c6_slave.bin"
    PRIV_REQUIRES nvs_flash esp_wifi esp_event esp_netif json esp_timer esp_app_format esp_http_server esp-sr
)

target_compile_definitions(${COMPONENT_LIB} PRIVATE LV_LVGL_H_INCLUDE_SIMPLE)

# Dev-only features (screenshot watcher). OFF in production so nothing extra runs
# on the render path / spends internal RAM. Deploy dev with:
#   idf.py -DDESKLOCK_DEVMODE=ON build flash
# and back to production with -DDESKLOCK_DEVMODE=OFF (the value sticks in the
# CMake cache until you flip it).
option(DESKLOCK_DEVMODE "Enable dev-only features (screenshot watcher)" OFF)
if(DESKLOCK_DEVMODE)
    target_compile_definitions(${COMPONENT_LIB} PRIVATE DESKLOCK_DEVMODE=1)
    message(STATUS "DeskLock: DEVMODE ON — screenshot watcher enabled")
endif()
