diff options
| author | ruki <[email protected]> | 2017-07-20 13:38:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-07-20 13:38:04 +0800 |
| commit | e5d685f1fdba2977986950b13dc851682d3f7bcc (patch) | |
| tree | 5725eb45128a427c625d0a54073bfdfd4ae9b770 /xmake/core/base/global.lua | |
| parent | 37e1e4b70b3f0f29e695603f1ba5ce1fd96f7417 (diff) | |
fix config readonly mode for vs201x plugin
Diffstat (limited to 'xmake/core/base/global.lua')
| -rw-r--r-- | xmake/core/base/global.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/xmake/core/base/global.lua b/xmake/core/base/global.lua index 823603722..0bced098f 100644 --- a/xmake/core/base/global.lua +++ b/xmake/core/base/global.lua @@ -59,20 +59,28 @@ function global.readonly(name) end -- set the given configure to the current -function global.set(name, value, readonly) +-- +-- @param name the name +-- @param value the value +-- @param opt the argument options, .e.g {readonly = false, force = false} +-- +function global.set(name, value, opt) -- check assert(name) + -- init options + opt = opt or {} + -- check readonly - assert(not global.readonly(name), "cannot set readonly global: " .. name) + assert(opt.force or not global.readonly(name), "cannot set readonly global: " .. name) -- set it global._CONFIGS = global._CONFIGS or {} global._CONFIGS[name] = value -- mark as readonly - if readonly then + if opt.readonly then global._MODES = global._MODES or {} global._MODES["__readonly_" .. name] = true end |
