diff options
| author | ruki <[email protected]> | 2018-09-20 23:20:15 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-09-20 14:01:31 +0800 |
| commit | da5fb50e0b9b8c1942f0793425c8fdd5d29d57ff (patch) | |
| tree | 550b4e589e35fbb711ebdb9d72e9a3313a60a9e1 /xmake | |
| parent | 4067509774711e1f6c530c48f88de6159f4eb4e2 (diff) | |
add LD_LIBRARY_PATH
Diffstat (limited to 'xmake')
| -rw-r--r-- | xmake/core/platform/environment.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/core/platform/environment.lua b/xmake/core/platform/environment.lua index d77ec0d85..569780159 100644 --- a/xmake/core/platform/environment.lua +++ b/xmake/core/platform/environment.lua @@ -35,18 +35,24 @@ local package = require("package/package") function environment._enter_toolchains() -- save the toolchains environment - environment._PATHES = os.getenv("path") + environment._PATH = os.getenv("path") + environment._LD_LIBRARY_PATH = os.getenv("LD_LIBRARY_PATH") -- add search binary pathes of packages os.addenv("PATH", path.join(package.prefixdir(true), "release", os.host(), os.arch(), "bin")) -- globaldir/release/../bin os.addenv("PATH", path.join(package.prefixdir(false), "release", os.host(), os.arch(), "bin")) -- localdir/release/../bin + if os.host() ~= "windows" then + os.addenv("LD_LIBRARY_PATH", path.join(package.prefixdir(true), "release", os.host(), os.arch(), "lib")) -- globaldir/release/../lib + os.addenv("LD_LIBRARY_PATH", path.join(package.prefixdir(false), "release", os.host(), os.arch(), "lib")) -- localdir/release/../lib + end end -- leave the toolchains environment function environment._leave_toolchains() -- leave the toolchains environment - os.setenv("path", environment._PATHES) + os.setenv("PATH", environment._PATH) + os.setenv("LD_LIBRARY_PATH", environment._LD_LIBRARY_PATH) end -- enter the environment for the current platform |
