zengine/engine/xmake/rule_api/package_api.lua

18 lines
689 B
Lua
Raw Normal View History

2024-11-27 22:33:09 +08:00
import("core.project.project")
function main(target)
for _, pkg in pairs(target:pkgs()) do
if pkg:requireconf("configs","copy") then
local link = pkg:get("links")
local targetdir = target:targetdir()
link = link[1] or link
2025-02-11 11:16:46 +08:00
if is_mode("debug") and not os.isdir(targetdir) then
os.mkdir(targetdir)
end
2024-11-28 22:12:11 +08:00
if link and os.isdir(targetdir) and not os.isfile(path.join(targetdir, link .. ".lib")) then
2024-11-27 22:33:09 +08:00
local linkdirs = pkg:get("linkdirs")
os.trycp(linkdirs.."/*", targetdir)
print("copy",linkdirs, targetdir)
end
end
end
end