From 28b5447453e7acbafa5670578f891d71028a394e Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 12 Dec 2024 23:27:48 +0800 Subject: improve package envs --- xmake/core/package/package.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 39b01e51f..dc016a327 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 package: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 package:config("shared") then envs.LD_LIBRARY_PATH = {"lib"} if os.host() == "macosx" then envs.DYLD_LIBRARY_PATH = {"lib"} -- cgit v1.3.1 From 63d3cafeacd89213324a77f15242f64d016ad8bf Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 12 Dec 2024 23:39:36 +0800 Subject: fix error --- xmake/core/package/package.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index dc016a327..4575f454d 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1073,13 +1073,13 @@ function _instance:_rawenvs() envs.PATH = table.wrap(bindirs) elseif self:is_binary() then envs.PATH = {"bin"} - elseif os.host() == "windows" and self:is_plat("windows", "mingw") and package:config("shared") then + elseif os.host() == "windows" and self:is_plat("windows", "mingw") 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()) and package:config("shared") 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"} -- cgit v1.3.1 From dc64ef1360682592440852ddd3fb7d228c096820 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 13 Dec 2024 00:56:17 +0800 Subject: fix arch --- xmake/core/package/package.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 4575f454d..f5c38f337 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1073,7 +1073,7 @@ function _instance:_rawenvs() envs.PATH = table.wrap(bindirs) elseif self:is_binary() then envs.PATH = {"bin"} - elseif os.host() == "windows" and self:is_plat("windows", "mingw") and self:config("shared") then + 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 -- cgit v1.3.1