diff options
Diffstat (limited to 'xmake/modules/private/action/require/impl/package.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 516b0be89..e33b34bbf 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -663,6 +663,11 @@ function _load_package(packagename, requireinfo, opt) -- get package from cache first local package_cached = _memcache():get2("packages", packagekey) if package_cached then + -- since toplevel is not part of packagekey, we need to ensure it's part of the cached package table too + if requireinfo.is_toplevel and not package_cached:is_toplevel() then + package_cached:requireinfo().is_toplevel = true + end + return package_cached end |
