From 33f1ec40fdfdcba4e2ae1e40d0050868ca4dca76 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 4 Sep 2023 23:51:00 +0800 Subject: get librarydeps with private --- xmake/modules/private/action/require/impl/package.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xmake/modules/private/action/require/impl/package.lua') diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 77b4abbd0..ea7d8d621 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -296,13 +296,13 @@ end -- -- orderdeps: a -> b -> c -- -function _sort_librarydeps(package) +function _sort_librarydeps(package, opt) -- we must use native deps list instead of package:deps() to generate correct link order local orderdeps = {} for _, dep in ipairs(package:plaindeps()) do - if dep and dep:is_library() and not dep:is_private() then + if dep and dep:is_library() and (opt and opt.private or not dep:is_private()) then table.insert(orderdeps, dep) - table.join2(orderdeps, _sort_librarydeps(dep)) + table.join2(orderdeps, _sort_librarydeps(dep, opt)) end end return orderdeps @@ -936,6 +936,7 @@ function _load_packages(requires, opt) package._PLAINDEPS = plaindeps package._ORDERDEPS = table.unique(_sort_packagedeps(package)) package._LIBRARYDEPS = table.reverse_unique(_sort_librarydeps(package)) + package._LIBRARYDEPS_WITH_PRIVATE = table.reverse_unique(_sort_librarydeps(package, {private = true})) end end -- cgit v1.3.1