From e372a64df110f3700a37edb42968a6275376b9d4 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 19 Jul 2025 00:54:36 +0800 Subject: add pkgenvs to target --- xmake/core/sandbox/modules/import/core/project/project.lua | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.3.1