summaryrefslogtreecommitdiff
path: root/xmake/core/project/config.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-01-19 22:34:13 +0800
committerruki <[email protected]>2021-01-19 22:34:13 +0800
commitd9189f7cd7843a39346a288a58a884ea9dcdf792 (patch)
treec6f46912091d7abb54fa8349a7a675ed294c48da /xmake/core/project/config.lua
parent576784050e14cd1eed1ab9284399e2731a885335 (diff)
improve config
Diffstat (limited to 'xmake/core/project/config.lua')
-rw-r--r--xmake/core/project/config.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/xmake/core/project/config.lua b/xmake/core/project/config.lua
index 78bdc2907..a5107e456 100644
--- a/xmake/core/project/config.lua
+++ b/xmake/core/project/config.lua
@@ -29,10 +29,8 @@ local table = require("base/table")
local utils = require("base/utils")
local option = require("base/option")
--- get the current given configure
+-- get the current given configuration
function config.get(name)
-
- -- get it
local value = nil
if config._CONFIGS then
value = config._CONFIGS[name]
@@ -40,8 +38,6 @@ function config.get(name)
value = nil
end
end
-
- -- get it
return value
end
@@ -150,8 +146,17 @@ function config.load()
return false
end
end
- config._CONFIGS = configs
- return true
+ -- merge into the current configuration
+ local ok = false
+ if configs then
+ for name, value in pairs(configs) do
+ if config.get(name) == nil then
+ config.set(name, value)
+ ok = true
+ end
+ end
+ end
+ return ok
end
-- save the project configuration