summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-11-05 22:45:54 +0800
committerruki <[email protected]>2025-11-07 15:01:57 +0800
commit69393d505d86bdbbc522861045cb41d590c69b72 (patch)
tree2d5111c0e765060bb981271dddb99b8722352787
parentff868710ce0378664d89f63411eb1f9b75dc1781 (diff)
fix option
-rw-r--r--xmake/core/base/option.lua11
1 files changed, 1 insertions, 10 deletions
diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua
index d258a1451..9c750c30b 100644
--- a/xmake/core/base/option.lua
+++ b/xmake/core/base/option.lua
@@ -119,7 +119,7 @@ function option.init(menu)
end
-- not found?
- if not context.taskname or not menu[context.taskname] then
+ if xmake.in_main_thread() and (not context.taskname or not menu[context.taskname]) then
option.show_main()
return false, "invalid task: " .. xmake._COMMAND
end
@@ -314,21 +314,12 @@ end
function option.taskmenu(task)
assert(option._MENU)
- -- the current task
task = task or option.taskname() or "main"
-
- -- get the task menu
local taskmenu = option._MENU[task]
if type(taskmenu) == "function" then
-
- -- load this task menu
taskmenu = taskmenu()
-
- -- save this task menu
option._MENU[task] = taskmenu
end
-
- -- get it
return taskmenu
end