if(CONFIG_ZMK_DISPLAY)
  target_sources_ifdef(CONFIG_CUSTOM_WIDGET_BATTERY_STATUS app PRIVATE widgets/battery_status.c)
  target_sources_ifdef(CONFIG_CUSTOM_WIDGET_OUTPUT_STATUS app PRIVATE widgets/output_status.c)
  target_sources_ifdef(CONFIG_CUSTOM_WIDGET_LAYER_STATUS app PRIVATE widgets/layer_status.c)
  target_sources_ifdef(CONFIG_CUSTOM_WIDGET_PERIPHERAL_STATUS app PRIVATE widgets/peripheral_status.c)

  add_subdirectory_ifdef(CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM widgets/icons)
endif()

zephyr_library()

if(CONFIG_ZMK_DISPLAY)
  if(CONFIG_CUSTOM_WIDGET_BATTERY_STATUS)
    zephyr_library_sources(widgets/icons/batt_100.c)
    zephyr_library_sources(widgets/icons/batt_100_chg.c)
    zephyr_library_sources(widgets/icons/batt_75.c)
    zephyr_library_sources(widgets/icons/batt_75_chg.c)
    zephyr_library_sources(widgets/icons/batt_50.c)
    zephyr_library_sources(widgets/icons/batt_50_chg.c)
    zephyr_library_sources(widgets/icons/batt_25.c)
    zephyr_library_sources(widgets/icons/batt_25_chg.c)
    zephyr_library_sources(widgets/icons/batt_5.c)
    zephyr_library_sources(widgets/icons/batt_5_chg.c)
    zephyr_library_sources(widgets/icons/batt_0.c)
    zephyr_library_sources(widgets/icons/batt_0_chg.c)
  endif()
  if(CONFIG_CUSTOM_WIDGET_PERIPHERAL_STATUS)
    zephyr_library_sources(widgets/icons/bluetooth_advertising.c)
    zephyr_library_sources(widgets/icons/bluetooth_connected_right.c)
    zephyr_library_sources(widgets/icons/bluetooth_disconnected_right.c)
  endif()
  if(CONFIG_CUSTOM_WIDGET_OUTPUT_STATUS)
    zephyr_library_sources(widgets/icons/USB_connected.c)
    zephyr_library_sources(widgets/icons/bluetooth_connected_1.c)
    zephyr_library_sources(widgets/icons/bluetooth_connected_2.c)
    zephyr_library_sources(widgets/icons/bluetooth_connected_3.c)
    zephyr_library_sources(widgets/icons/bluetooth_connected_4.c)
    zephyr_library_sources(widgets/icons/bluetooth_connected_5.c)
    zephyr_library_sources(widgets/icons/bluetooth_advertising_1.c)
    zephyr_library_sources(widgets/icons/bluetooth_advertising_2.c)
    zephyr_library_sources(widgets/icons/bluetooth_advertising_3.c)
    zephyr_library_sources(widgets/icons/bluetooth_advertising_4.c)
    zephyr_library_sources(widgets/icons/bluetooth_advertising_5.c)
    zephyr_library_sources(widgets/icons/bluetooth_disconnected_right.c)
  endif()
  if(CONFIG_CUSTOM_WIDGET_LAYER_STATUS)
    zephyr_library_sources(widgets/icons/layers.c)
    zephyr_library_sources(widgets/icons/layers2.c)
  endif()
  if(NOT CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
    zephyr_library_sources(widgets/icons/zenlogo.c)
  endif()
endif()

zephyr_library_include_directories(${ZEPHYR_LVGL_MODULE_DIR})
zephyr_library_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl/)
zephyr_library_sources_ifdef(CONFIG_ZMK_DISPLAY custom_status_screen.c)
zephyr_library_sources(${ZEPHYR_BASE}/misc/empty_file.c)
zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
