summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/scripts/base/main.lua')
-rw-r--r--xmake/scripts/base/main.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua
index 830a958d6..2624c8d53 100644
--- a/xmake/scripts/base/main.lua
+++ b/xmake/scripts/base/main.lua
@@ -573,7 +573,13 @@ end
-- the main function
function main.done()
- -- init option first
+ -- init project directory first
+ local projectdir = option.find(xmake._ARGV, "project", "P")
+ if projectdir then
+ xmake._PROJECT_DIR = path.absolute(projectdir)
+ end
+
+ -- init option
if not option.init(xmake._ARGV, menu) then
return -1
end