diff options
| author | ruki <[email protected]> | 2024-07-25 12:00:26 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-07-25 12:00:26 +0800 |
| commit | 4d53a1fbe312d896756bf86b35fa45d9e6fe90e2 (patch) | |
| tree | 7a6186ae34a3e574420f70126891795d851e9d88 /xmake/core/package/package.lua | |
| parent | 001cb3aff6bf009b942c2fd882f2b06012b7b6a5 (diff) | |
| parent | 7ad05dc941aa400582ad2357217ab976fd55b576 (diff) | |
Merge pull request #5392 from xmake-io/bindirs
add bindirs for pacakge
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index b4249c6a0..fd5d52433 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1032,7 +1032,10 @@ function _instance:_rawenvs() envs = {} -- add bin PATH - if self:is_binary() or self:is_plat("windows", "mingw") then -- bin/*.dll for windows + local bindirs = self:get("bindirs") + if bindirs then + envs.PATH = table.wrap(bindirs) + elseif self:is_binary() or self:is_plat("windows", "mingw") then -- bin/*.dll for windows envs.PATH = {"bin"} end @@ -1863,6 +1866,7 @@ function _instance:find_tool(name, opt) self._find_tool = self._find_tool or sandbox_module.import("lib.detect.find_tool", {anonymous = true}) return self._find_tool(name, {cachekey = opt.cachekey or "fetch_package_system", installdir = self:installdir({readonly = true}), + bindirs = self:get("bindirs"), version = true, -- we alway check version require_version = opt.require_version, norun = opt.norun, @@ -1888,6 +1892,7 @@ function _instance:find_package(name, opt) return self._find_package(name, { force = opt.force, installdir = self:installdir({readonly = true}), + bindirs = self:get("bindirs"), version = true, -- we alway check version require_version = opt.require_version, mode = self:mode(), @@ -2714,6 +2719,7 @@ function package.apis() , "package.set_sourcedir" , "package.set_cachedir" , "package.set_installdir" + , "package.add_bindirs" -- package.add_xxx , "package.add_deps" , "package.add_urls" |
