cmake_minimum_required(VERSION 3.5)

add_definitions(-DLV_LVGL_H_INCLUDE_SIMPLE)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(mcu_fw)

# The firmware builds at -Og (CONFIG_COMPILER_OPTIMIZATION_DEBUG); mbedTLS's
# bignum/ECC code at -Og made one HTTPS handshake to the Shiny Link device API
# take ~6 s on the 160 MHz ESP32. -O2 for the crypto libraries only.
foreach(_lib mbedcrypto mbedx509 mbedtls)
    if(TARGET ${_lib})
        target_compile_options(${_lib} PRIVATE -O2)
    endif()
endforeach()
