From 67e4fc13ac7f28a9f73799f9d8f5652867f01c23 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 16 Feb 2021 00:45:17 +0800 Subject: improve toplevel --- xmake/core/package/package.lua | 8 +------- xmake/modules/private/action/require/impl/package.lua | 6 ------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 0e8d90001..7ea6461bb 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -316,14 +316,8 @@ function _instance:is_library() end -- is top level? user top requires in xmake.lua --- @note we cannot use `not package:parents()`, because we may patch deps for toolchain/packages function _instance:is_toplevel() - return self._IS_TOPLEVEL == true -end - --- mark as top level -function _instance:mark_toplevel() - self._IS_TOPLEVEL = true + return not self:parents() end -- get the filelock of the whole package directory diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 45b92a612..2759b0fd0 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -589,12 +589,6 @@ function _load_packages(requires, opt) -- maybe package not found and optional if package then - -- mark as top level - -- @note we cannot use `not package:parents()`, because we may patch deps for toolchain/packages - if not opt.parentinfo then - package:mark_toplevel() - end - -- load dependent packages and save them first of this package if not package._DEPS then local deps = package:get("deps") -- cgit v1.3.1