summaryrefslogtreecommitdiff
path: root/xmake/core/project/option.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-19 22:56:34 +0800
committerruki <[email protected]>2017-07-19 22:56:34 +0800
commit0614ca6a2eebcf8b4d4be3c6171a783731720888 (patch)
tree2400dd538374fa88f322ede41e8cdb0b1ffb24b9 /xmake/core/project/option.lua
parent1ea7269e5078041df9c170b020953273ea176675 (diff)
fix flush option bug
Diffstat (limited to 'xmake/core/project/option.lua')
-rw-r--r--xmake/core/project/option.lua19
1 files changed, 6 insertions, 13 deletions
diff --git a/xmake/core/project/option.lua b/xmake/core/project/option.lua
index d8e347ca9..ba3b19904 100644
--- a/xmake/core/project/option.lua
+++ b/xmake/core/project/option.lua
@@ -72,11 +72,6 @@ function option:_clear()
option._cache():set(self:name(), nil)
end
--- flush the option cache to file
-function option:_flush()
- option._cache():flush()
-end
-
-- check option for c/c++
function option:_cx_check()
@@ -218,9 +213,8 @@ function option:set_value(value)
-- set value to option
config.set(self:name(), value)
- -- save option and flush cache to file
+ -- save option
self:_save()
- self:_flush()
end
-- clear the option status and need recheck it
@@ -231,9 +225,6 @@ function option:clear()
-- clear this option in cache
self:_clear()
-
- -- flush cache to file
- self:_flush()
end
-- this option is enabled?
@@ -255,9 +246,6 @@ function option:enable(enabled)
else
self:_clear()
end
-
- -- flush cache to file
- self:_flush()
end
-- dump this option
@@ -336,5 +324,10 @@ function option.load(name)
return instance
end
+-- save all options to the cache file
+function option.save()
+ option._cache():flush()
+end
+
-- return module
return option