KOS newlib does not support popen, system, or tmpfile. Without
LUA_USE_C89, Lua's os library tries to register wrappers for these
functions, which can leave the os table nil and crash with
"attempt to index a nil value" during sandbox creation.
Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Also renames lua/lua.hpp to lua/lua_global.hpp.
The previous name broke version auto-detection in sol2, which involves
calling `__has_include(<lua/lua.hpp>)`.
On CMake v3.28+, `EXCLUDE_FROM_ALL` is supported natively as an argument
to `FetchContent_Declare`.
On CMake v3.30+, `FetchContent_Populate`, which we use to polyfill
`EXCLUDE_FROM_ALL` support for older versions of CMake, is deprecated
and triggers a noisy warning.
Avoids the warning by using the native `EXCLUDE_FROM_ALL` support on
CMake v3.28+.