summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-12-13 08:53:36 +0800
committerGitHub <[email protected]>2024-12-13 08:53:36 +0800
commit7e33780d50ce0798a79d8b6c833821129d3ce795 (patch)
treed69b68b23308410d7b6702f593dac3729d044e33
parent3c99013d8f3f465616918f21e0e2e6deb701f9f3 (diff)
parentdc64ef1360682592440852ddd3fb7d228c096820 (diff)
Merge pull request #5959 from xmake-io/envs
improve package envs
-rw-r--r--xmake/core/package/package.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 39b01e51f..f5c38f337 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -1071,12 +1071,15 @@ function _instance:_rawenvs()
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
+ elseif self:is_binary() then
+ envs.PATH = {"bin"}
+ elseif os.host() == "windows" and self:is_plat("windows", "mingw") and self:is_arch(os.arch()) and self:config("shared") then
+ -- bin/*.dll for windows
envs.PATH = {"bin"}
end
-- add LD_LIBRARY_PATH to load *.so directory
- if os.host() ~= "windows" and self:is_plat(os.host()) and self:is_arch(os.arch()) then
+ if os.host() ~= "windows" and self:is_plat(os.host()) and self:is_arch(os.arch()) and self:config("shared") then
envs.LD_LIBRARY_PATH = {"lib"}
if os.host() == "macosx" then
envs.DYLD_LIBRARY_PATH = {"lib"}