ecs/flint.lua

71 lines
1.3 KiB
Lua

lib "lua"
src("*vendor/lua", "-vendor/lua/lua.c")
include "vendor/lua"
include "vendor/headers"
warnings(false)
lib "sol2"
include "vendor/sol2"
dependency "lua"
lib "stduuid"
include "vendor/stduuid/include"
link "uuid"
lib "ecs"
path "ecs"
dependency("sol2", "stduuid")
lib "ecs-lua"
path "ecs-lua"
dependency "ecs"
subfile("../iohelper/flint.lua", "iohelper")
lib "ecs-serial"
path "ecs-serial"
dependency("ecs", "iohelper")
function codegen(path, file)
local handle = io.popen("mkdir " .. config.paths.build .. "/generated")
handle:close()
local command = "python test.py " .. path .. "/" .. file .. " > " .. config.paths.build .. "/generated/ecs_" .. file
handle = io.popen(command)
handle:close()
end
executable "test"
path "test"
dependency "ecs-lua"
dependency "ecs-serial"
hook(step.PRE_BUILD, codegen, "test/include", "components.h")
include(config.paths.build .. "/generated/")
lib "network-shared"
path "network-shared"
dependency "ecs-serial"
hook(step.PRE_BUILD, codegen, "network-shared/include", "network_components.h")
include(config.paths.build .. "/generated/")
executable "server"
path "network-server"
dependency "network-shared"
threads()
executable "client"
path "network-client"
run_dir "test"
run_target "test"