Skip to content

Commit

Permalink
improve package envs
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Dec 12, 2024
1 parent 3c99013 commit 28b5447
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xmake/core/package/package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit 28b5447

Please sign in to comment.