summaryrefslogtreecommitdiff
path: root/xmake/core/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-08-25 22:45:08 +0800
committerruki <[email protected]>2023-08-25 22:45:08 +0800
commitdbce160c77c6bc28f42b506cd6fbfc2bd051621f (patch)
tree771f9d0bcc0b70ac3d0aebdb9dc809433b14dd2b /xmake/core/main.lua
parentacbcf6923d556f0926f1e8f10d87e80f7a894be9 (diff)
add emmylua debugger
Diffstat (limited to 'xmake/core/main.lua')
-rw-r--r--xmake/core/main.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua
index bb883d659..796a69b44 100644
--- a/xmake/core/main.lua
+++ b/xmake/core/main.lua
@@ -40,6 +40,7 @@ local config = require("project/config")
local project = require("project/project")
local localcache = require("cache/localcache")
local profiler = require("base/profiler")
+local debugger = require("base/debugger")
-- init the option menu
local menu =
@@ -139,6 +140,14 @@ end
-- the init function for main
function main._init()
+ -- start debugger
+ if debugger:enabled() then
+ local ok, errors = debugger:start()
+ if not ok then
+ return false, errors
+ end
+ end
+
-- disable scheduler first
scheduler:enable(false)
@@ -148,9 +157,9 @@ function main._init()
-- e.g. `xmake f -c -P xxx` will be parsed as `-c=-P`, it's incorrect.
--
-- maybe we will improve this later
- local options, err = main._basicparse()
+ local options, errors = main._basicparse()
if not options then
- return false, err
+ return false, errors
end
-- init project paths only for xmake engine