diff options
| author | ruki <[email protected]> | 2021-10-02 23:29:03 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-02 23:29:03 +0800 |
| commit | e80a41789b0de5f2249c15d57486fd3a4b40ff99 (patch) | |
| tree | f3a893345c8da889236e68775dc3de92f1a092e9 /xmake/includes/check_cflags.lua | |
| parent | d4789ff5e968294bf2e9831209d0cf61b61c9d43 (diff) | |
save and restore scope
Diffstat (limited to 'xmake/includes/check_cflags.lua')
| -rw-r--r-- | xmake/includes/check_cflags.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xmake/includes/check_cflags.lua b/xmake/includes/check_cflags.lua index 85c9ef3c7..ef3f7866b 100644 --- a/xmake/includes/check_cflags.lua +++ b/xmake/includes/check_cflags.lua @@ -28,6 +28,7 @@ function check_cflags(definition, flags, opt) opt = opt or {} local optname = "__" .. (opt.name or definition) + save_scope() option(optname) add_defines(definition) on_check(function (option) @@ -37,6 +38,7 @@ function check_cflags(definition, flags, opt) end end) option_end() + restore_scope() add_options(optname) end @@ -54,6 +56,7 @@ function configvar_check_cflags(definition, flags, opt) opt = opt or {} local optname = "__" .. (opt.name or definition) local defname, defval = unpack(definition:split('=')) + save_scope() option(optname) if opt.default == nil then set_configvar(defname, defval or 1, {quote = opt.quote}) @@ -65,6 +68,7 @@ function configvar_check_cflags(definition, flags, opt) end end) option_end() + restore_scope() if opt.default == nil then add_options(optname) else |
