diff options
| author | xq114 <[email protected]> | 2021-09-24 12:20:02 +0800 |
|---|---|---|
| committer | xq114 <[email protected]> | 2021-09-24 12:20:02 +0800 |
| commit | 5f353149251447da48617b597fc2020d24c6bc2f (patch) | |
| tree | 2ded4089a8ea576fc6f1deeb00174a5e7c79264c | |
| parent | 113108b4a6cbda7211d42a133b29eb90f688bc8e (diff) | |
use opt.quote in place of opt.number
| -rw-r--r-- | xmake/includes/check_csnippets.lua | 4 | ||||
| -rw-r--r-- | xmake/includes/check_cxxsnippets.lua | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/xmake/includes/check_csnippets.lua b/xmake/includes/check_csnippets.lua index 492c80a56..95aa0b2d5 100644 --- a/xmake/includes/check_csnippets.lua +++ b/xmake/includes/check_csnippets.lua @@ -60,6 +60,8 @@ function check_csnippets(definition, snippets, opt) if option:value() then if opt.number then option:add("defines", definition .. "=" .. tonumber(option:value())) + elseif opt.quote == false then + option:add("defines", definition .. "=" .. option:value()) else option:add("defines", definition .. "=\"" .. option:value() .. "\"") end @@ -113,7 +115,7 @@ function configvar_check_csnippets(definition, snippets, opt) if opt.output then after_check(function (option) if option:value() then - option:set("configvar", defname, opt.number and tonumber(option:value()) or option:value()) + option:set("configvar", defname, opt.number and tonumber(option:value()) or option:value(), {quote = opt.quote}) end end) end diff --git a/xmake/includes/check_cxxsnippets.lua b/xmake/includes/check_cxxsnippets.lua index a65ed7355..b46c650ff 100644 --- a/xmake/includes/check_cxxsnippets.lua +++ b/xmake/includes/check_cxxsnippets.lua @@ -60,6 +60,8 @@ function check_cxxsnippets(definition, snippets, opt) if option:value() then if opt.number then option:add("defines", definition .. "=" .. tonumber(option:value())) + elseif opt.quote == false then + option:add("defines", definition .. "=" .. option:value()) else option:add("defines", definition .. "=\"" .. option:value() .. "\"") end @@ -113,7 +115,7 @@ function configvar_check_cxxsnippets(definition, snippets, opt) if opt.output then after_check(function (option) if option:value() then - option:set("configvar", defname, opt.number and tonumber(option:value()) or option:value()) + option:set("configvar", defname, opt.number and tonumber(option:value()) or option:value(), {quote = opt.quote}) end end) end |
