diff options
| author | xq114 <[email protected]> | 2021-09-23 21:59:21 +0800 |
|---|---|---|
| committer | xq114 <[email protected]> | 2021-09-23 21:59:21 +0800 |
| commit | 6e5bd0a99336d5ef17e9b7c312d547b6a683d13e (patch) | |
| tree | 628cf31298c0554d98278af8cefb25c6719eb665 /xmake/includes/check_cfuncs.lua | |
| parent | fbccc2375dba05f227ff8e6ec0b61c9357ca449d (diff) | |
improve configvar_check_ functions
Diffstat (limited to 'xmake/includes/check_cfuncs.lua')
| -rw-r--r-- | xmake/includes/check_cfuncs.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/includes/check_cfuncs.lua b/xmake/includes/check_cfuncs.lua index 45b80519f..42d06e5ff 100644 --- a/xmake/includes/check_cfuncs.lua +++ b/xmake/includes/check_cfuncs.lua @@ -75,7 +75,9 @@ function configvar_check_cfuncs(definition, funcs, opt) local defname, defval = unpack(definition:split('=')) option(optname) add_cfuncs(funcs) - set_configvar(defname, defval or 1) + if opt.default == nil then + set_configvar(defname, defval or 1, {quote = opt.quote}) + end if opt.links then add_links(opt.links) end @@ -98,5 +100,9 @@ function configvar_check_cfuncs(definition, funcs, opt) set_warnings(opt.warnings) end option_end() - add_options(optname) + if opt.default == nil then + add_options(optname) + else + set_configvar(defname, has_config(optname) and (defval or 1) or opt.default, {quote = opt.quote}) + end end |
