summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-08-07 22:27:28 +0800
committerruki <[email protected]>2021-08-07 22:27:28 +0800
commitae33b24ea5ecb6608168e869bb8ee94e0f674c98 (patch)
treedd9d38f4c3ce533577c03fea691a46c378feb39b
parentb82ffd74db0a424c9c94b3e499c6be7e94f558e2 (diff)
improve package
-rw-r--r--xmake/actions/package/local/main.lua1
-rw-r--r--xmake/actions/package/remote/main.lua17
2 files changed, 13 insertions, 5 deletions
diff --git a/xmake/actions/package/local/main.lua b/xmake/actions/package/local/main.lua
index 21c807091..74bb1cfa1 100644
--- a/xmake/actions/package/local/main.lua
+++ b/xmake/actions/package/local/main.lua
@@ -32,7 +32,6 @@ function _get_linkdeps(target)
for _, depname in ipairs(target:get("deps")) do
local dep = project.target(depname)
if not ((target:is_binary() or target:is_shared()) and dep:is_static()) then
- table.join2(linkdeps, _get_linkdeps(dep))
table.insert(linkdeps, dep:name())
end
end
diff --git a/xmake/actions/package/remote/main.lua b/xmake/actions/package/remote/main.lua
index 064141b56..b38fa6626 100644
--- a/xmake/actions/package/remote/main.lua
+++ b/xmake/actions/package/remote/main.lua
@@ -26,6 +26,18 @@ import("core.project.config")
import("core.project.project")
import("lib.luajit.bit")
+-- get link deps
+function _get_linkdeps(target)
+ local linkdeps = {}
+ for _, depname in ipairs(target:get("deps")) do
+ local dep = project.target(depname)
+ if not ((target:is_binary() or target:is_shared()) and dep:is_static()) then
+ table.insert(linkdeps, dep:name())
+ end
+ end
+ return linkdeps
+end
+
-- package remote
function _package_remote(target)
@@ -41,10 +53,7 @@ function _package_remote(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
+ local deps = _get_linkdeps(target)
file:print("package(\"%s\")", packagename)
if target:is_binary() then
file:print(" set_kind(\"binary\")")