diff options
Diffstat (limited to 'xmake/core')
| -rw-r--r-- | xmake/core/base/os.lua | 17 | ||||
| -rw-r--r-- | xmake/core/project/config.lua | 8 |
2 files changed, 15 insertions, 10 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index d20cd671a..d50ce19f2 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -768,15 +768,24 @@ function os.tmpdir(opt) -- get root tmpdir local tmpdir_root = nil if opt and opt.ramdisk == false then + tmpdir_root = os._ROOT_TMPDIR if os._ROOT_TMPDIR == nil then - os._ROOT_TMPDIR = (os.getenv("XMAKE_TMPDIR") or os.getenv("TMPDIR") or os._tmpdir()):trim() + tmpdir_root = (os.getenv("XMAKE_TMPDIR") or os.getenv("TMPDIR") or os._tmpdir()):trim() + -- TODO + if os.islink(tmpdir_root) then + tmpdir_root = os.readlink(tmpdir_root) or tmpdir_root + end + os._ROOT_TMPDIR = tmpdir_root end - tmpdir_root = os._ROOT_TMPDIR else + tmpdir_root = os._ROOT_TMPDIR_RAM if os._ROOT_TMPDIR_RAM == nil then - os._ROOT_TMPDIR_RAM = (os.getenv("XMAKE_TMPDIR") or os._ramdir() or os.getenv("TMPDIR") or os._tmpdir()):trim() + tmpdir_root = (os.getenv("XMAKE_TMPDIR") or os._ramdir() or os.getenv("TMPDIR") or os._tmpdir()):trim() + if os.islink(tmpdir_root) then + tmpdir_root = os.readlink(tmpdir_root) or tmpdir_root + end + os._ROOT_TMPDIR_RAM = tmpdir_root end - tmpdir_root = os._ROOT_TMPDIR_RAM end -- make sub-directory name diff --git a/xmake/core/project/config.lua b/xmake/core/project/config.lua index 47d9406a8..93c1ff6af 100644 --- a/xmake/core/project/config.lua +++ b/xmake/core/project/config.lua @@ -165,13 +165,9 @@ function config.builddir(opt) builddir = path.absolute(builddir, rootdir) end - -- Adjust path for the current directory, - -- If it's an external directory, use the absolute path directly. + -- adjust path for the current directory if not opt.absolute then - local relativedir = path.relative(builddir, os.curdir()) - if not relativedir:startswith("..") then - builddir = relativedir - end + builddir = path.relative(builddir, os.curdir()) end return builddir end |
