diff options
| author | ruki <[email protected]> | 2019-08-21 00:44:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-08-20 22:24:37 +0800 |
| commit | a5def1ed021b1b5ba296fe22a7177f00285eaad9 (patch) | |
| tree | b424467ee43373f056f5a690ce1e6bcde09102da | |
| parent | 928607630eb03a5afcf63f3076fc2a99e859bdd7 (diff) | |
fix some code styles
| -rw-r--r-- | xmake/actions/run/main.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/xmake/actions/run/main.lua b/xmake/actions/run/main.lua index a3c1d5702..0ec951d41 100644 --- a/xmake/actions/run/main.lua +++ b/xmake/actions/run/main.lua @@ -30,15 +30,10 @@ import("core.platform.environment") import("devel.debugger") -- add search directories for all dependent shared libraries on windows -function _make_runpath(target) +function _make_runpath_on_windows(target) - if not (is_plat("windows") or (is_plat("mingw") and is_host("windows"))) then - return {} - end - - local searchdirs = hashset.new() local pathenv = {} - + local searchdirs = hashset.new() local function insert(dir) if not path.is_absolute(dir) then dir = path.absolute(dir, os.projectdir()) @@ -66,6 +61,8 @@ end -- run target function _do_run_target(target) + + -- only for binary program if target:targetkind() ~= "binary" then return end @@ -93,7 +90,10 @@ function _do_run_target(target) end end - os.addenv("PATH", table.unpack(_make_runpath(target))) + -- add search directories for all dependent shared libraries on windows + if is_plat("windows") or (is_plat("mingw") and is_host("windows")) then + os.addenv("PATH", table.unpack(_make_runpath_on_windows(target))) + end -- debugging? if option.get("debug") then |
