28 lines
645 B
Lua
28 lines
645 B
Lua
add_rules("mode.debug", "mode.release")
|
|
add_rules("plugin.compile_commands.autoupdate")
|
|
|
|
set_languages("c23")
|
|
|
|
set_warnings("all")
|
|
set_warnings("error")
|
|
|
|
add_requires("civetweb")
|
|
|
|
target("math")
|
|
set_kind("binary")
|
|
add_packages("civetweb")
|
|
add_includedirs("include")
|
|
add_files("src/main.c")
|
|
|
|
after_build(function (target)
|
|
local npm = "npm"
|
|
if is_host("windows") then
|
|
npm = "npm.cmd"
|
|
end
|
|
os.execv(npm, {"--prefix", "ui", "run", "build"})
|
|
|
|
local vue_dist_dir = "ui/dist"
|
|
local target_dir = target:targetdir() .. "/www"
|
|
os.cp(vue_dist_dir, target_dir)
|
|
end)
|