From 94b012d18fd70123dfb3997248fa3148c1730162 Mon Sep 17 00:00:00 2001 From: A2va <49582555+A2va@users.noreply.github.com> Date: Wed, 29 Nov 2023 21:52:34 +0100 Subject: Add toolchain runenvs in run action --- xmake/modules/private/action/run/runenvs.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xmake/modules/private/action/run/runenvs.lua b/xmake/modules/private/action/run/runenvs.lua index 9f1473335..87d5bbe1c 100644 --- a/xmake/modules/private/action/run/runenvs.lua +++ b/xmake/modules/private/action/run/runenvs.lua @@ -58,6 +58,14 @@ function _make_runpath_on_windows(target) end insert_target(dep) end + for _, toolchain in ipairs(target:toolchains()) do + local runenvs = toolchain:get("runenvs") + if runenvs then + for _, runenv in pairs(runenvs) do + insert(runenv) + end + end + end end end -- cgit v1.3.1 From 13c1fee798f96df6fc6043a913b87e5e4109f2c0 Mon Sep 17 00:00:00 2001 From: A2va <49582555+A2va@users.noreply.github.com> Date: Wed, 29 Nov 2023 22:31:52 +0100 Subject: runenv can a be a table --- xmake/modules/private/action/run/runenvs.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xmake/modules/private/action/run/runenvs.lua b/xmake/modules/private/action/run/runenvs.lua index 87d5bbe1c..e8d3d8e4c 100644 --- a/xmake/modules/private/action/run/runenvs.lua +++ b/xmake/modules/private/action/run/runenvs.lua @@ -62,7 +62,13 @@ function _make_runpath_on_windows(target) local runenvs = toolchain:get("runenvs") if runenvs then for _, runenv in pairs(runenvs) do - insert(runenv) + if type(runenv) == "table" then + for _, env in ipairs(runenv) do + insert(env) + end + else + insert(runenv) + end end end end -- cgit v1.3.1 From 522dac17e58f964da97499724189e7e0f5bf57e9 Mon Sep 17 00:00:00 2001 From: A2va <49582555+A2va@users.noreply.github.com> Date: Thu, 30 Nov 2023 22:15:01 +0100 Subject: insert only PATH values --- xmake/modules/private/action/run/runenvs.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/xmake/modules/private/action/run/runenvs.lua b/xmake/modules/private/action/run/runenvs.lua index e8d3d8e4c..1a7ba05ac 100644 --- a/xmake/modules/private/action/run/runenvs.lua +++ b/xmake/modules/private/action/run/runenvs.lua @@ -59,16 +59,10 @@ function _make_runpath_on_windows(target) insert_target(dep) end for _, toolchain in ipairs(target:toolchains()) do - local runenvs = toolchain:get("runenvs") - if runenvs then - for _, runenv in pairs(runenvs) do - if type(runenv) == "table" then - for _, env in ipairs(runenv) do - insert(env) - end - else - insert(runenv) - end + local runenvs = toolchain:runenvs() + if runenvs and runenvs.PATH then + for _, env in ipairs(path.splitenv(runenvs.PATH)) do + insert(env) end end end -- cgit v1.3.1