From 58c8e709cc4677ec6fb5fdfcec1958fab6743709 Mon Sep 17 00:00:00 2001 From: Opportunity Date: Tue, 30 Jun 2020 11:48:32 +0800 Subject: fix auto complete --- xmake/core/project/target.lua | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'xmake/core/project/target.lua') diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 652ae4758..d7f44c4af 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -881,24 +881,28 @@ function _instance:targetdir() -- get build directory targetdir = config.buildir() + end - -- append plat sub-directory - local plat = self:plat() - if plat then - targetdir = path.join(targetdir, plat) - end + if not targetdir then + return nil + end - -- 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) - end + -- 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 -- ok? -- cgit v1.3.1