summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2026-02-19 22:39:41 +0800
committerruki <[email protected]>2026-02-19 22:39:41 +0800
commit562cd7187775c7b7184cc7da5fffd0dcc77550d3 (patch)
tree220676c0f290f4649cb99c0c3ce4a03e59db56bd /xmake
parenta7e81f8efefb7d1a621d4a47bfa5208a761d7af4 (diff)
fix tmpdir for haiku
Diffstat (limited to 'xmake')
-rw-r--r--xmake/core/base/os.lua17
-rw-r--r--xmake/core/project/config.lua8
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