diff options
| author | ruki <[email protected]> | 2017-03-01 17:35:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-03-01 17:35:30 +0800 |
| commit | 2db00e130e92302f04eaba6e4c2936fe0879b5fc (patch) | |
| tree | 5426c16d495416d66a11c9eb7f95195a9510d872 /xmake/core/project/config.lua | |
| parent | 1ab4daf4fbdd148dc5b3ee879d36e9829e4753d7 (diff) | |
fix buildir bug
Diffstat (limited to 'xmake/core/project/config.lua')
| -rw-r--r-- | xmake/core/project/config.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xmake/core/project/config.lua b/xmake/core/project/config.lua index 8765b535d..2f3ce1a96 100644 --- a/xmake/core/project/config.lua +++ b/xmake/core/project/config.lua @@ -116,6 +116,26 @@ function config.options() return configs end +-- get the buildir +function config.buildir() + + -- get it + local buildir = config.get("buildir") + if buildir then + + -- get the absolute path first + if not path.is_absolute(buildir) then + buildir = path.absolute(buildir, xmake._PROJECT_DIR) + end + + -- adjust path for the current directory + buildir = path.relative(buildir, os.curdir()) + end + + -- ok? + return buildir +end + -- get the configure directory function config.directory() |
