diff options
Diffstat (limited to 'xmake/scripts')
| -rw-r--r-- | xmake/scripts/base/config.lua | 11 | ||||
| -rw-r--r-- | xmake/scripts/base/global.lua | 15 |
2 files changed, 18 insertions, 8 deletions
diff --git a/xmake/scripts/base/config.lua b/xmake/scripts/base/config.lua index 05edfc555..6c8a22f58 100644 --- a/xmake/scripts/base/config.lua +++ b/xmake/scripts/base/config.lua @@ -181,6 +181,11 @@ function config._file() return config.directory() .. "/xmake.xconf" end +-- need configure? +function config._need(name) + return name and name ~= "target" and name ~= "file" and name ~= "project" and name ~= "verbose" and name ~= "clean" +end + -- get the current target scope function config._target() @@ -301,7 +306,7 @@ function config.loadxconf() local configures = {} for _, o in ipairs(option._MENU.config.options) do local name = o[2] - if name and name ~= "target" and name ~= "file" and name ~= "project" and name ~= "verbose" then + if config._need(name) then configures[i] = name i = i + 1 end @@ -365,7 +370,7 @@ function config.loadxconf() assert(type(k) == "string") -- skip some options - if not k:startswith("_") and k ~= "project" and k ~= "file" and k ~= "verbose" and k ~= "target" then + if not k:startswith("_") and config._need(k) then -- save the option to the target target[k] = v @@ -379,7 +384,7 @@ function config.loadxconf() assert(type(k) == "string") -- skip some options - if k ~= "project" and k ~= "file" and k ~= "verbose" and k ~= "target" then + if config._need(k) then -- save the default option to the target if not target[k] then diff --git a/xmake/scripts/base/global.lua b/xmake/scripts/base/global.lua index 9e43213ee..2b3582a23 100644 --- a/xmake/scripts/base/global.lua +++ b/xmake/scripts/base/global.lua @@ -133,6 +133,11 @@ function global._file() return global.directory() .. "/xmake.xconf" end +-- need configure? +function global._need(name) + return name and name ~= "verbose" and name ~= "clean" +end + -- get the given configure from the current function global.get(name) @@ -226,7 +231,7 @@ function global.loadxconf() local configures = {} for _, o in ipairs(option._MENU.global.options) do local name = o[2] - if name and name ~= "verbose" then + if global._need(name) then configures[i] = name i = i + 1 end @@ -258,8 +263,8 @@ function global.loadxconf() -- check assert(type(k) == "string") - -- skip some options - if not k:startswith("_") and k ~= "verbose" then + -- need configure it? + if not k:startswith("_") and global._need(k) then configs[k] = v end end @@ -270,8 +275,8 @@ function global.loadxconf() -- check assert(type(k) == "string") - -- skip some options - if k ~= "verbose" then + -- need configure it? + if global._need(k) then -- save the default option if not configs[k] then |
