summaryrefslogtreecommitdiff
path: root/xmake/modules/lib
diff options
context:
space:
mode:
authorruki <[email protected]>2017-06-30 16:01:56 +0800
committerruki <[email protected]>2017-06-30 16:01:56 +0800
commit871af6a0239ee82fb269efa022a0ce7cda4dd866 (patch)
tree47ba2573889b721f5fdb37aee0d76fdad193f611 /xmake/modules/lib
parent4e283aa257fec00eb9a8e994bf976cc03491fdc2 (diff)
disable cache for has_cxsnippets
Diffstat (limited to 'xmake/modules/lib')
-rw-r--r--xmake/modules/lib/detect/has_cxsnippets.lua22
1 files changed, 2 insertions, 20 deletions
diff --git a/xmake/modules/lib/detect/has_cxsnippets.lua b/xmake/modules/lib/detect/has_cxsnippets.lua
index 233c43d83..59ef12872 100644
--- a/xmake/modules/lib/detect/has_cxsnippets.lua
+++ b/xmake/modules/lib/detect/has_cxsnippets.lua
@@ -118,7 +118,7 @@ end
-- @param snippets the snippets
-- @param opt the argument options
-- .e.g
--- { name = "", verbose = false, target = [target|option], sourcekind = "[cc|cxx]"
+-- { verbose = false, target = [target|option], sourcekind = "[cc|cxx]"
-- , types = {"wchar_t", "char*"}, includes = "stdio.h", funcs = {"sigsetjmp", "sigsetjmp((void*)0, 0)"}}
--
-- funcs:
@@ -142,19 +142,6 @@ function main(snippets, opt)
-- init snippets
snippets = snippets or {}
- -- init cache and key
- local key = opt.name
- local results = _g._RESULTS or {}
-
- -- get result from the cache first
- if key ~= nil then
- key = key .. (opt.sourcekind or "")
- local ok = results[key]
- if ok ~= nil then
- return ok
- end
- end
-
-- get links
local links = table.wrap(opt.links)
if opt.target then
@@ -188,6 +175,7 @@ function main(snippets, opt)
local binaryfile = os.tmpfile() .. ".b"
io.writefile(sourcefile, sourcecode)
+ -- @note cannot cache result, all conditions will be changed
-- attempt to compile it
local ok = try
{
@@ -233,12 +221,6 @@ function main(snippets, opt)
end
end
- -- save result to cache
- if key ~= nil then
- results[key] = ifelse(ok, ok, false)
- _g._RESULTS = results
- end
-
-- ok?
return ok
end