summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-02 23:06:00 +0800
committerruki <[email protected]>2020-06-02 12:36:02 +0800
commit433ac3c54d5cad4409ef24fe44f32ccef1da2c13 (patch)
treeb5d477d83f8727560f43e4163ba4197376544824
parenteafcb33f997146804594f3e6cd404c7d658ee1b0 (diff)
add comments
-rw-r--r--xmake/core/project/config.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/xmake/core/project/config.lua b/xmake/core/project/config.lua
index 382ab03e0..837e45faf 100644
--- a/xmake/core/project/config.lua
+++ b/xmake/core/project/config.lua
@@ -131,7 +131,14 @@ function config.buildir()
-- get the absolute path first
if not path.is_absolute(buildir) then
- buildir = path.absolute(buildir, os.projectdir())
+ local rootdir
+ if os.isdir(path.join(os.workingdir(), ".xmake")) then
+ -- we switch to independent working directory @see https://github.com/xmake-io/xmake/issues/820
+ rootdir = os.workingdir()
+ else
+ rootdir = os.projectdir()
+ end
+ buildir = path.absolute(buildir, rootdir)
end
-- adjust path for the current directory
@@ -150,6 +157,7 @@ function config.directory()
if config._DIRECTORY == nil then
local rootdir = os.getenv("XMAKE_CONFIGDIR")
if not rootdir and os.isdir(path.join(os.workingdir(), ".xmake")) then
+ -- we switch to independent working directory @see https://github.com/xmake-io/xmake/issues/820
rootdir = os.workingdir()
end
if not rootdir then