From 287d1e2ca2bd376d488f91d58dd36f45d2a3cf6a Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 21 Nov 2020 20:23:52 +0800 Subject: add DYLD_LIBRARY_PATH --- xmake/core/package/package.lua | 5 ++++- 1 file changed, 4 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 b46077f08..4361cb29d 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -434,6 +434,9 @@ function _instance:envs() -- 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 envs.LD_LIBRARY_PATH = {"lib"} + if os.host() == "macosx" then + envs.DYLD_LIBRARY_PATH = {"lib"} + end end self._ENVS = envs end @@ -465,7 +468,7 @@ function _instance:envs_enter() local installdir = self:installdir() for name, values in pairs(self:envs()) do oldenvs[name] = oldenvs[name] or os.getenv(name) - if name == "PATH" or name == "LD_LIBRARY_PATH" then + if name == "PATH" or name == "LD_LIBRARY_PATH" or name == "DYLD_LIBRARY_PATH" then for _, value in ipairs(values) do if path.is_absolute(value) then os.addenv(name, value) -- cgit v1.3.1