diff options
| author | ruki <[email protected]> | 2015-07-15 16:11:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-07-15 16:11:24 +0800 |
| commit | e22322e392bff5be8a9870369f3bd1fa04760c16 (patch) | |
| tree | 6fe076f8441e6b96da3ebdac710d584f8e54500a | |
| parent | 2f55b44e1e3fd6f53ca43b9127d9dd5c49cc1880 (diff) | |
checking multiple links for options
| -rw-r--r-- | xmake/scripts/base/project.lua | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua index 1cd8b5f25..9e003a59d 100644 --- a/xmake/scripts/base/project.lua +++ b/xmake/scripts/base/project.lua @@ -653,31 +653,27 @@ end -- make option for checking links function project._make_option_for_checking_links(opt, links, cfile, objectfile, targetfile) - -- done - for _, link in ipairs(utils.wrap(links)) do - - -- this links has been checked? - project._CHECKED_LINKS = project._CHECKED_LINKS or {} - if project._CHECKED_LINKS[link] then return true end - - -- only for compile a object file - local ok = compiler.check_include(opt, nil, cfile, objectfile) - - -- check link - if ok then ok = linker.check_links(opt, link, objectfile, targetfile) end + -- the links string + local links_str = table.concat(utils.wrap(links), ", ") + + -- this links has been checked? + project._CHECKED_LINKS = project._CHECKED_LINKS or {} + if project._CHECKED_LINKS[links_str] then return true end + + -- only for compile a object file + local ok = compiler.check_include(opt, nil, cfile, objectfile) - -- trace - utils.verbose("checking for the link %s ... %s", link, utils.ifelse(ok, "ok", "no")) + -- check link + if ok then ok = linker.check_links(opt, links, objectfile, targetfile) end - -- cache the result - project._CHECKED_LINKS[link] = ok + -- trace + utils.verbose("checking for the links %s ... %s", links_str, utils.ifelse(ok, "ok", "no")) - -- failed - if not ok then return false end - end + -- cache the result + project._CHECKED_LINKS[links_str] = ok - -- ok - return true + -- ok? + return ok end -- make option for checking cincludes |
