diff options
| author | ruki <[email protected]> | 2022-06-03 00:55:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-06-03 00:55:31 +0800 |
| commit | 8e5e0c6038239eae863341bcf060f6d0ae4e7348 (patch) | |
| tree | f98fdd93bd8d8d4338f38becaa55006e7b127ba5 | |
| parent | 73eab3a212c5db9ca2f739ba4b4a3ab80e662072 (diff) | |
improve option/showmenu
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | xmake/actions/config/menuconf.lua | 2 | ||||
| -rw-r--r-- | xmake/core/project/project.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_cflags.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_cfuncs.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_cincludes.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_csnippets.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_ctypes.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_cxxflags.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_cxxfuncs.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_cxxincludes.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_cxxsnippets.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_cxxtypes.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_features.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_links.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_macros.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/check_syslinks.lua | 2 | ||||
| -rw-r--r-- | xmake/includes/find_and_add_packages.lua | 1 |
18 files changed, 33 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 32e13ba43..fd2e75668 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Add `preprocessor.linemarkers` policy to disable linemarkers to speed up ccache/distcc * [#2389](https://github.com/xmake-io/xmake/issues/2389): Improve `xmake run` to parallel running of targets +* [#2417](https://github.com/xmake-io/xmake/issues/2417): Switch the default value of option/showmenu ## v2.6.7 @@ -1295,6 +1296,7 @@ * 添加 `preprocessor.linemarkers` 策略去禁用 linemarkers 去加速 ccache/distcc * [#2389](https://github.com/xmake-io/xmake/issues/2389): 改进 `xmake run` 支持并行运行目标程序 +* [#2417](https://github.com/xmake-io/xmake/issues/2417): 切换 option/showmenu 的默认值,默认开启 ## v2.6.7 diff --git a/xmake/actions/config/menuconf.lua b/xmake/actions/config/menuconf.lua index 94ec2782e..3d5d29123 100644 --- a/xmake/actions/config/menuconf.lua +++ b/xmake/actions/config/menuconf.lua @@ -302,7 +302,7 @@ function app:_project_configs(cache) local keys = table.orderkeys(options) for _, key in ipairs(keys) do local opt = options[key] - if opt:get("showmenu") then + if opt:get("showmenu") ~= false then local category = "." if opt:get("category") then category = table.unwrap(opt:get("category")) end options_by_category[category] = options_by_category[category] or {} diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 9a80da1aa..66f696bbb 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -1174,7 +1174,7 @@ function project.menu() for name, opt in pairs(opts) do -- show menu? - if opt:get("showmenu") then + if opt:get("showmenu") ~= false then -- the default value local default = "auto" diff --git a/xmake/includes/check_cflags.lua b/xmake/includes/check_cflags.lua index 63354dfac..773992a1e 100644 --- a/xmake/includes/check_cflags.lua +++ b/xmake/includes/check_cflags.lua @@ -30,6 +30,7 @@ function check_cflags(definition, flags, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_defines(definition) on_check(function (option) import("core.tool.compiler") @@ -58,6 +59,7 @@ function configvar_check_cflags(definition, flags, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) end diff --git a/xmake/includes/check_cfuncs.lua b/xmake/includes/check_cfuncs.lua index 51352e424..f7f4a3e25 100644 --- a/xmake/includes/check_cfuncs.lua +++ b/xmake/includes/check_cfuncs.lua @@ -36,6 +36,7 @@ function check_cfuncs(definition, funcs, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_cfuncs(funcs) add_defines(definition) if opt.links then @@ -79,6 +80,7 @@ function configvar_check_cfuncs(definition, funcs, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_cfuncs(funcs) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/check_cincludes.lua b/xmake/includes/check_cincludes.lua index c954b5260..8bed49968 100644 --- a/xmake/includes/check_cincludes.lua +++ b/xmake/includes/check_cincludes.lua @@ -30,6 +30,7 @@ function check_cincludes(definition, includes, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_cincludes(includes) if opt.includedirs then add_includedirs(opt.includedirs) @@ -54,6 +55,7 @@ function configvar_check_cincludes(definition, includes, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_cincludes(includes) if opt.includedirs then add_includedirs(opt.includedirs) diff --git a/xmake/includes/check_csnippets.lua b/xmake/includes/check_csnippets.lua index 19e87ab9e..0424b5361 100644 --- a/xmake/includes/check_csnippets.lua +++ b/xmake/includes/check_csnippets.lua @@ -31,6 +31,7 @@ function check_csnippets(definition, snippets, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_csnippets(definition, snippets, {tryrun = opt.tryrun, output = opt.output}) if not opt.output then add_defines(definition) @@ -90,6 +91,7 @@ function configvar_check_csnippets(definition, snippets, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_csnippets(definition, snippets, {tryrun = opt.tryrun, output = opt.output}) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/check_ctypes.lua b/xmake/includes/check_ctypes.lua index d14c64aa7..3b9c7395e 100644 --- a/xmake/includes/check_ctypes.lua +++ b/xmake/includes/check_ctypes.lua @@ -30,6 +30,7 @@ function check_ctypes(definition, types, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_ctypes(types) add_defines(definition) if opt.languages then @@ -67,6 +68,7 @@ function configvar_check_ctypes(definition, types, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_ctypes(types) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/check_cxxflags.lua b/xmake/includes/check_cxxflags.lua index c93745134..9efdd7339 100644 --- a/xmake/includes/check_cxxflags.lua +++ b/xmake/includes/check_cxxflags.lua @@ -30,6 +30,7 @@ function check_cxxflags(definition, flags, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_defines(definition) on_check(function (option) import("core.tool.compiler") @@ -58,6 +59,7 @@ function configvar_check_cxxflags(definition, flags, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) end diff --git a/xmake/includes/check_cxxfuncs.lua b/xmake/includes/check_cxxfuncs.lua index 241effd19..b1e2f5c0d 100644 --- a/xmake/includes/check_cxxfuncs.lua +++ b/xmake/includes/check_cxxfuncs.lua @@ -36,6 +36,7 @@ function check_cxxfuncs(definition, funcs, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_cxxfuncs(funcs) add_defines(definition) if opt.links then @@ -79,6 +80,7 @@ function configvar_check_cxxfuncs(definition, funcs, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_cxxfuncs(funcs) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/check_cxxincludes.lua b/xmake/includes/check_cxxincludes.lua index 15f4fa1df..a8ac48d90 100644 --- a/xmake/includes/check_cxxincludes.lua +++ b/xmake/includes/check_cxxincludes.lua @@ -30,6 +30,7 @@ function check_cxxincludes(definition, includes, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_cxxincludes(includes) add_defines(definition) option_end() @@ -51,6 +52,7 @@ function configvar_check_cxxincludes(definition, includes, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_cxxincludes(includes) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/check_cxxsnippets.lua b/xmake/includes/check_cxxsnippets.lua index 9405b5707..2f460b713 100644 --- a/xmake/includes/check_cxxsnippets.lua +++ b/xmake/includes/check_cxxsnippets.lua @@ -31,6 +31,7 @@ function check_cxxsnippets(definition, snippets, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_cxxsnippets(definition, snippets, {tryrun = opt.tryrun, output = opt.output}) if not opt.output then add_defines(definition) @@ -90,6 +91,7 @@ function configvar_check_cxxsnippets(definition, snippets, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_cxxsnippets(definition, snippets, {tryrun = opt.tryrun, output = opt.output}) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/check_cxxtypes.lua b/xmake/includes/check_cxxtypes.lua index 928ecbad5..3a1ab58ef 100644 --- a/xmake/includes/check_cxxtypes.lua +++ b/xmake/includes/check_cxxtypes.lua @@ -30,6 +30,7 @@ function check_cxxtypes(definition, types, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_cxxtypes(types) add_defines(definition) if opt.languages then @@ -67,6 +68,7 @@ function configvar_check_cxxtypes(definition, types, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_cxxtypes(types) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/check_features.lua b/xmake/includes/check_features.lua index 481d9b6fe..fa7a89a73 100644 --- a/xmake/includes/check_features.lua +++ b/xmake/includes/check_features.lua @@ -30,6 +30,7 @@ function check_features(definition, features, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_features(features) add_defines(definition) if opt.languages then @@ -63,6 +64,7 @@ function configvar_check_features(definition, features, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_features(features) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/check_links.lua b/xmake/includes/check_links.lua index 25ddaa619..2fb0512ad 100644 --- a/xmake/includes/check_links.lua +++ b/xmake/includes/check_links.lua @@ -30,6 +30,7 @@ function check_links(definition, links, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_links(links) add_defines(definition) option_end() @@ -51,6 +52,7 @@ function configvar_check_links(definition, links, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_links(links) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/check_macros.lua b/xmake/includes/check_macros.lua index 352a2382f..1f5d441f7 100644 --- a/xmake/includes/check_macros.lua +++ b/xmake/includes/check_macros.lua @@ -32,6 +32,7 @@ function check_macros(definition, macros, opt) local snippets = {} save_scope() option(optname) + set_showmenu(false) for _, macro in ipairs(macros) do if macro:find(' ', 1, true) then table.insert(snippets, ([[ @@ -85,6 +86,7 @@ function configvar_check_macros(definition, macros, opt) local snippets = {} save_scope() option(optname) + set_showmenu(false) for _, macro in ipairs(macros) do if macro:find(' ', 1, true) then table.insert(snippets, ([[ diff --git a/xmake/includes/check_syslinks.lua b/xmake/includes/check_syslinks.lua index 379bb005a..73b332f9e 100644 --- a/xmake/includes/check_syslinks.lua +++ b/xmake/includes/check_syslinks.lua @@ -30,6 +30,7 @@ function check_syslinks(definition, links, opt) local optname = "__" .. (opt.name or definition) save_scope() option(optname) + set_showmenu(false) add_syslinks(links) add_defines(definition) option_end() @@ -51,6 +52,7 @@ function configvar_check_syslinks(definition, links, opt) local defname, defval = table.unpack(definition:split('=')) save_scope() option(optname) + set_showmenu(false) add_syslinks(links) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) diff --git a/xmake/includes/find_and_add_packages.lua b/xmake/includes/find_and_add_packages.lua index 4bcdd76f9..eddc15d3a 100644 --- a/xmake/includes/find_and_add_packages.lua +++ b/xmake/includes/find_and_add_packages.lua @@ -35,6 +35,7 @@ function find_and_add_packages(...) local optname = "__" .. name save_scope() option(optname) + set_showmenu(false) before_check(function (option) option:add(find_packages(name)) end) |
