diff options
Diffstat (limited to 'xmake/actions/config/main.lua')
| -rwxr-xr-x | xmake/actions/config/main.lua | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index 6e60c4793..84aa468fb 100755 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -23,10 +23,22 @@ -- imports import("core.base.option") import("core.project.config") +import("core.project.global") + +-- filter option +function _option_filter(name) + return name and name ~= "target" and name ~= "file" and name ~= "project" and name ~= "verbose" and name ~= "clean" +end -- main function main() + -- load global configure + global.load() + + -- load project configure + config.load(option.get("target")) + -- clean the cached configure? if option.get("clean") then @@ -34,23 +46,28 @@ function main() config.clean() end - --[[ - -- merge the options + -- override the configure for the current options for name, value in pairs(option.options()) do - if name ~= "verbose" and name ~= "clean" then + if _option_filter(name) then + config.set(name, value) + end + end + + -- merge the global configure + for name, value in pairs(global.options()) do + if config.get(name) == nil then config.set(name, value) end end -- merge the default options for name, value in pairs(option.defaults()) do - if name ~= "verbose" and name ~= "clean" then + if _option_filter(name) and config.get(name) == nil then config.set(name, value) end end - ]] -- probe the configure with value: "auto" --- config.probe() + config.probe() end |
