Skip to content

Commit

Permalink
improve buildir
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Sep 2, 2022
1 parent 25caa47 commit e59566a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion xmake/core/project/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,17 @@ function config.buildir(opt)

-- get the absolute path first
opt = opt or {}
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()
end
if not rootdir then
rootdir = os.projectdir()
end
local buildir = config.get("buildir") or "build"
if not path.is_absolute(buildir) then
buildir = path.absolute(buildir, os.projectdir())
buildir = path.absolute(buildir, rootdir)
end

-- adjust path for the current directory
Expand Down

0 comments on commit e59566a

Please sign in to comment.