diff options
| author | ruki <[email protected]> | 2017-06-20 13:04:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-06-20 13:04:30 +0800 |
| commit | 763ea08c17ff6655e3128a057fb9d69017d69edf (patch) | |
| tree | cf98935fc052b992ed735f29c88f94e098aabe25 | |
| parent | 0ef4acaa5f9d78c7fd8941ccbe8d3f237e91268c (diff) | |
fix cache bug and add verbose trace
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_program.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/lib/detect/has_flags.lua | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua index 57355780b..a09436d72 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua @@ -142,7 +142,7 @@ end function sandbox_lib_detect_find_program.main(name, pathes, check) -- attempt to get result from cache first - local cacheinfo = cache:load("find_program") + local cacheinfo = cache.load("find_program") local result = cacheinfo[name] if result ~= nil then return utils.ifelse(result, result, nil) diff --git a/xmake/modules/lib/detect/has_flags.lua b/xmake/modules/lib/detect/has_flags.lua index bbd972c0d..7da2d98d8 100644 --- a/xmake/modules/lib/detect/has_flags.lua +++ b/xmake/modules/lib/detect/has_flags.lua @@ -23,6 +23,7 @@ -- -- imports +import("core.base.option") import("lib.detect.find_tool") -- has this flag? @@ -60,6 +61,11 @@ function _has_flag(name, flag, opt) result = try { function () os.runv(tool.program, {flag}); return true end } end + -- trace + if option.get("verbose") then + cprint("checking for the flags %s ... %s", flag, ifelse(result, "${green}ok", "${red}no")) + end + -- save result to cache results[key] = ifelse(result, result, false) _g._RESULTS = results |
