diff options
| author | ruki <[email protected]> | 2021-02-16 00:45:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-16 00:45:17 +0800 |
| commit | 67e4fc13ac7f28a9f73799f9d8f5652867f01c23 (patch) | |
| tree | 4ed620984ed9e47a33dc755dd240d6e5f3628cd7 | |
| parent | 1ea0bc0d59e6b9123411d51bf37db903e0b4cfab (diff) | |
improve toplevel
| -rw-r--r-- | xmake/core/package/package.lua | 8 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 6 |
2 files changed, 1 insertions, 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") |
