I am trying to build a simple xmake based app, with the usual lua scripting, but how to write an xmake.lua for this still eludes me. For now I have this:
add_rules("mode.debug", "mode.release")
add_requires("lua")
target("Elevated")
set_kind("binary")
add_packages("lua")
add_files("src/*.c")
and in my /src I have main.c file while .lua scripts are in, let’s say /engine dir. Build succeeds with this main.c:
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
lua_State *L = luaL_newstate();
luaL_openlibs(L);
luaL_dofile(L, "engine/main.lua");
return 0;
}
but I am amiss at how to move .lua scripts dir using xmake.lua. Obviously, I can copy it manually to the same dir where the built executable is, but I’m curious is there anything in xmake to automate this.