summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-07-21 09:03:43 +0800
committerGitHub <[email protected]>2025-07-21 09:03:43 +0800
commitee0c655c4d3706079f3286bacd2fe7519e59e038 (patch)
tree8bade84b291199e39a307695c6ab70177592f284
parenta9815125c97acfb5d587232e0bdc475675f804bf (diff)
parente372a64df110f3700a37edb42968a6275376b9d4 (diff)
Merge pull request #6641 from xmake-io/pkgenvs
add pkgenvs to target/config
-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