summaryrefslogtreecommitdiff
path: root/xmake/actions/package/local/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-06-02 22:54:27 +0800
committerruki <[email protected]>2021-06-02 22:54:27 +0800
commit8dda67ba52ed67cc3e6897849658872c2ef4ddcc (patch)
treea6f1b6681af1d2958409e117acc39edaa6ea4e6a /xmake/actions/package/local/main.lua
parent16919177c72aa5934113d37932e0b60c8d4a52df (diff)
add deps for localpackages
Diffstat (limited to 'xmake/actions/package/local/main.lua')
-rw-r--r--xmake/actions/package/local/main.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/actions/package/local/main.lua b/xmake/actions/package/local/main.lua
index aa834eb79..b4114cb12 100644
--- a/xmake/actions/package/local/main.lua
+++ b/xmake/actions/package/local/main.lua
@@ -111,8 +111,13 @@ function _package_library(target)
-- generate xmake.lua
local file = io.open(path.join(packagedir, "xmake.lua"), "w")
if file then
+ local deps = {}
+ for _, dep in ipairs(target:orderdeps()) do
+ table.insert(deps, dep:name())
+ end
file:print([[package("%s")
set_description("%s")
+ %s
on_load(function (package)
package:set("installdir", path.join(os.scriptdir(), package:plat(), package:arch(), package:mode()))
end)
@@ -124,6 +129,7 @@ function _package_library(target)
return result
end)]], packagename,
"The " .. packagename .. " package",
+ #deps > 0 and ("add_deps(\"" .. table.concat(deps, "\", \"") .. "\")") or "",
target:linkname(),
path.filename(targetfile))
file:close()