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_features.lua | |
| parent | fbccc2375dba05f227ff8e6ec0b61c9357ca449d (diff) | |
improve configvar_check_ functions
Diffstat (limited to 'xmake/includes/check_features.lua')
| -rw-r--r-- | xmake/includes/check_features.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/includes/check_features.lua b/xmake/includes/check_features.lua index 1340d32f5..e837c485c 100644 --- a/xmake/includes/check_features.lua +++ b/xmake/includes/check_features.lua @@ -60,7 +60,9 @@ function configvar_check_features(definition, features, opt) local defname, defval = unpack(definition:split('=')) option(optname) add_features(features) - set_configvar(defname, defval or 1) + if opt.default == nil then + set_configvar(defname, defval or 1, {quote = opt.quote}) + end if opt.languages then set_languages(opt.languages) end @@ -74,5 +76,9 @@ function configvar_check_features(definition, features, opt) add_cxxflags(opt.cxxflags) 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 |
