summaryrefslogtreecommitdiff
path: root/xmake/core/project/option.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-19 21:12:51 +0800
committerruki <[email protected]>2017-07-19 21:12:51 +0800
commit1ea7269e5078041df9c170b020953273ea176675 (patch)
treecade92c9dd13d9bc69f62007d5f41f717c4124ff /xmake/core/project/option.lua
parent2b52ec7d069e2a5b297b52f6696f70f3d53ff385 (diff)
fix config and add readonly mode
Diffstat (limited to 'xmake/core/project/option.lua')
-rw-r--r--xmake/core/project/option.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/core/project/option.lua b/xmake/core/project/option.lua
index 0400fd1d3..d8e347ca9 100644
--- a/xmake/core/project/option.lua
+++ b/xmake/core/project/option.lua
@@ -245,10 +245,12 @@ end
function option:enable(enabled)
-- enable or disable this option?
- config.set(self:name(), enabled)
+ if not config.readonly(self:name()) then
+ config.set(self:name(), enabled)
+ end
-- save or clear this option in cache
- if enabled then
+ if self:enabled() then
self:_save()
else
self:_clear()