summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua37
1 files changed, 21 insertions, 16 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 302f7cff8..8f51c339e 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -875,25 +875,30 @@ end
-- get the target directory
function _instance:targetdir()
- -- the target directory or build directory
- local targetdir = self:get("targetdir") or config.buildir()
+ -- the target directory
+ local targetdir = self:get("targetdir")
+ if not targetdir then
- -- append plat sub-directory
- local plat = self:plat()
- if plat then
- targetdir = path.join(targetdir, plat)
- end
+ -- get build directory
+ targetdir = config.buildir()
- -- append arch sub-directory
- local arch = self:arch()
- if arch then
- targetdir = path.join(targetdir, arch)
- end
+ -- append plat sub-directory
+ local plat = self:plat()
+ if plat then
+ targetdir = path.join(targetdir, plat)
+ end
- -- append mode sub-directory
- local mode = config.get("mode")
- if mode then
- targetdir = path.join(targetdir, mode)
+ -- append arch sub-directory
+ local arch = self:arch()
+ if arch then
+ targetdir = path.join(targetdir, arch)
+ end
+
+ -- append mode sub-directory
+ local mode = config.get("mode")
+ if mode then
+ targetdir = path.join(targetdir, mode)
+ end
end
return targetdir
end