summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-02-14 20:15:07 +0800
committerruki <[email protected]>2026-02-15 00:12:47 +0800
commitd83d2400d5c28ec5d6655a930aaa4ec913e873ae (patch)
tree1a04af5adff9c7db6ded9448efcaabb1435b441a
parentffe255c4b65044a833c166904a67b47cf6d14c5e (diff)
fix builddir
-rw-r--r--xmake/core/project/config.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/core/project/config.lua b/xmake/core/project/config.lua
index 93c1ff6af..47d9406a8 100644
--- a/xmake/core/project/config.lua
+++ b/xmake/core/project/config.lua
@@ -165,9 +165,13 @@ function config.builddir(opt)
builddir = path.absolute(builddir, rootdir)
end
- -- adjust path for the current directory
+ -- Adjust path for the current directory,
+ -- If it's an external directory, use the absolute path directly.
if not opt.absolute then
- builddir = path.relative(builddir, os.curdir())
+ local relativedir = path.relative(builddir, os.curdir())
+ if not relativedir:startswith("..") then
+ builddir = relativedir
+ end
end
return builddir
end