diff options
| author | ruki <[email protected]> | 2024-07-01 23:37:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-07-01 23:37:38 +0800 |
| commit | d7d835d9a2c39d06b8fcb5341d4e5dbb071016bf (patch) | |
| tree | 59c36734761410d7b555bcab5280db57df1742f3 | |
| parent | d59bb8aae509f7cbf62f3e4d72cfd44756f11f4d (diff) | |
fix targetdir
| -rw-r--r-- | xmake/core/project/target.lua | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index e3a8f71f6..5a7e9b77c 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1503,31 +1503,32 @@ function _instance:autogenfile(sourcefile, opt) end -- get the target directory -function _instance:targetdir(opt) +function _instance:targetdir() -- the target directory local targetdir = self:get("targetdir") if not targetdir then targetdir = config.buildir() - end - -- get root directory of target - local intermediate_directory = self:policy("build.intermediate_directory") - if (opt and opt.root) or intermediate_directory == false then - return targetdir - end - -- generate intermediate directory - local plat = self:plat() - if plat then - targetdir = path.join(targetdir, plat) - end - local arch = self:arch() - if arch then - targetdir = path.join(targetdir, arch) - end - local mode = config.mode() - if mode then - targetdir = path.join(targetdir, mode) + -- get root directory of target + local intermediate_directory = self:policy("build.intermediate_directory") + if intermediate_directory == false then + return targetdir + end + + -- generate intermediate directory + local plat = self:plat() + if plat then + targetdir = path.join(targetdir, plat) + end + local arch = self:arch() + if arch then + targetdir = path.join(targetdir, arch) + end + local mode = config.mode() + if mode then + targetdir = path.join(targetdir, mode) + end end return targetdir end |
