summaryrefslogtreecommitdiff
path: root/xmake/core/project
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-28 07:39:00 +0800
committerruki <[email protected]>2022-05-28 07:39:00 +0800
commit79d42b329c0b075a154fc9009e0d4294a5caafbf (patch)
tree461ccebd4e2c725f20064614d07ef2e06698b0d4 /xmake/core/project
parentd0a2d52633fcf5bc04ad6794ec287b3545d667bd (diff)
add packagedir
Diffstat (limited to 'xmake/core/project')
-rw-r--r--xmake/core/project/target.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 67e9cd08a..210a3d482 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1152,6 +1152,18 @@ function _instance:installdir()
return installdir
end
+-- get package directory
+function _instance:packagedir()
+ -- get the output directory
+ local outputdir = baseoption.get("outputdir") or config.buildir()
+ local packagename = self:name():lower()
+ if #packagename > 1 and bit.band(packagename:byte(2), 0xc0) == 0x80 then
+ utils.wprint("package(%s): cannot generate package, becauese it contains unicode characters!", packagename)
+ return
+ end
+ return path.join(outputdir, "packages", packagename:sub(1, 1), packagename)
+end
+
-- get rules of the source file
function _instance:filerules(sourcefile)