summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index 5c12d6b6d..70f135706 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -128,6 +128,11 @@ end
-- config target
function sandbox_core_project._config_target(target, opt)
+
+ -- enter the environments of the target packages
+ local oldenvs = os.addenvs(target:pkgenvs())
+
+ -- do config
local before_config = target:script("config_before")
if before_config then
before_config(target, opt)
@@ -160,6 +165,9 @@ function sandbox_core_project._config_target(target, opt)
if config_after then
config_after(target, opt)
end
+
+ -- leave the environments of the target packages
+ os.setenvs(oldenvs)
end
-- config targets, TODO: We should support parallel configuration