cmake_minimum_required(VERSION 3.16)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)

# The espressif/lua component's luaconf.h defaults to 64-bit
# (long long) Lua integers and errors out at compile time on this
# toolchain ("Compiler does not support 'long long'" -- LLONG_MAX isn't
# visible to it here, even though <limits.h> is included). Lua's own
# suggested fix for constrained/32-bit platforms: build with 32-bit
# integers/floats instead. Set globally (not just in lua_runtime's own
# CMakeLists.txt) so the Lua component's own .c files see the same
# definition -- otherwise its library and our calling code would
# disagree on the size of lua_Integer.
idf_build_set_property(COMPILE_DEFINITIONS "-DLUA_32BITS" APPEND)

project(kvida_os)
