summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/base/interpreter.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua
index f396e4fdf..b105b3423 100644
--- a/xmake/core/base/interpreter.lua
+++ b/xmake/core/base/interpreter.lua
@@ -229,6 +229,9 @@ function interpreter:_api_builtin_add_subdirfiles(isdirs, ...)
-- bind public scope
setfenv(script, self._PUBLIC)
+ -- clear the current scope, force to enter root scope
+ self._PRIVATE._SCOPES._CURRENT = nil
+
-- done interpreter
local ok, errors = xpcall(script, interpreter._traceback)
if not ok then