diff options
| -rw-r--r-- | xmake/core/base/option.lua | 11 |
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 |
