summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-09-29 20:57:24 +0800
committerruki <[email protected]>2018-09-29 20:57:24 +0800
commite2cb95d8d86a27fc401667ddad70af7c81bcb0fc (patch)
tree0a8bfd26e761a8401d7ae4892b13d28ffae242ce /xmake/core/package/package.lua
parent27294139797b23f90c3b46b860836f39a37d0e97 (diff)
modify install directory of package
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 5d3ee15e0..efd2e893b 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -195,7 +195,7 @@ end
function _instance:installdir(...)
-- make the given install directory
- local dir = path.join(self:cachedir(), "install", ...)
+ local dir = path.join(package.installdir(self:from("global"), self:debug(), self:plat(), self:arch()), self:name():sub(1, 1):lower(), self:name(), self:version_str(), ...)
-- ensure the install directory
if not os.isdir(dir) then
@@ -614,6 +614,11 @@ function package.cachedir()
return path.join(global.directory(), "cache", "packages")
end
+-- the install directory
+function package.installdir(is_global, is_debug, plat, arch)
+ return path.join(is_global and global.directory() or config.directory(), "installed", plat or os.host(), arch or os.arch(), is_debug and "debug" or "release")
+end
+
-- get the prefix directory
function package.prefixdir(is_global, is_debug, plat, arch)
return path.join(is_global and global.directory() or config.directory(), "prefix", plat or os.host(), arch or os.arch(), is_debug and "debug" or "release")