From 7ad05dc941aa400582ad2357217ab976fd55b576 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 25 Jul 2024 22:48:57 +0800 Subject: add bindirs for pacakge --- xmake/core/package/package.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xmake/core/package/package.lua') 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" -- cgit v1.3.1