diff options
| author | ruki <[email protected]> | 2022-08-01 22:59:50 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-01 22:59:50 +0800 |
| commit | 08353c53b3f207462b66a33b38c03de98f49ad1e (patch) | |
| tree | 525b45dcef8677934b40649bf0cda26a1f617180 | |
| parent | d0ff7053e8960602d0acfd4720973f515571e78a (diff) | |
add pkgenvs to on_config
| -rw-r--r-- | xmake/actions/config/main.lua | 4 | ||||
| -rw-r--r-- | xmake/rules/python/xmake.lua | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index 823ba08de..5fe36d443 100644 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -162,6 +162,7 @@ end -- config target function _config_target(target) + local oldenvs = os.addenvs(target:pkgenvs()) for _, rule in ipairs(target:orderules()) do local on_config = rule:script("config") if on_config then @@ -172,6 +173,9 @@ function _config_target(target) if on_config then on_config(target) end + if oldenvs then + os.setenvs(oldenvs) + end end -- config targets diff --git a/xmake/rules/python/xmake.lua b/xmake/rules/python/xmake.lua index 01c6ed858..d5649638b 100644 --- a/xmake/rules/python/xmake.lua +++ b/xmake/rules/python/xmake.lua @@ -20,7 +20,7 @@ -- @see https://github.com/xmake-io/xmake/issues/1896 rule("python.library") - on_load(function (target) + on_config(function (target) target:set("kind", "shared") target:set("prefixname", "") local soabi = target:extraconf("rules", "python.library", "soabi") @@ -40,4 +40,3 @@ rule("python.library") end end end) - |
