diff options
| author | ruki <[email protected]> | 2016-04-23 20:20:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-04-23 20:20:45 +0800 |
| commit | a40e8b5d84255edae664fab9b7192d15fedf92ba (patch) | |
| tree | 3c27772f0bfa088c190a9d5a758b141179081974 /xmake/core | |
| parent | 48a228f6bb2e4870bf0e4952c0c752ddeae72219 (diff) | |
add arguments for check arch
Diffstat (limited to 'xmake/core')
| -rw-r--r-- | xmake/core/platform/checker.lua | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/xmake/core/platform/checker.lua b/xmake/core/platform/checker.lua index 5a03bc132..4cbb70243 100644 --- a/xmake/core/platform/checker.lua +++ b/xmake/core/platform/checker.lua @@ -32,14 +32,26 @@ local global = require("project/global") local sandbox = require("sandbox/sandbox") local platform = require("platform/platform") --- check the list -function checker._checklist(funclist, ...) +-- check it +function checker._check(callers, ...) -- check all - for _, func in ipairs(table.wrap(funclist)) do + for _, caller in ipairs(table.wrap(callers)) do + + -- has arguments? + local args = nil + if type(caller) == "table" then + if #caller > 1 then + args = caller[2] + end + caller = caller[1] + end + + -- check + assert(type(caller) == "function") -- call it - local ok, errors = sandbox.load(func, ...) + local ok, errors = sandbox.load(caller, ..., args) if not ok then return false, errors end @@ -84,7 +96,7 @@ function checker.check(name) end -- check it - return checker._checklist(module.get("config"), config) + return checker._check(module.get("config"), config) -- check the global configure? elseif name == "global" then @@ -108,7 +120,7 @@ function checker.check(name) end -- check it - local ok, errors = checker._checklist(module.get("global"), global) + local ok, errors = checker._check(module.get("global"), global) if not ok then return false, errors end |
