diff options
| author | ruki <[email protected]> | 2017-06-29 10:23:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-06-29 10:23:38 +0800 |
| commit | 741d881be8b5f0ba62dd38bdb5f7fe32909f1263 (patch) | |
| tree | 3e2a479cd5a482eae1da00614dacd037edf3fb20 /xmake/modules/lib/detect | |
| parent | c45a4613ce40f939b52c2ccd883712ff30d54dcc (diff) | |
avoid detect the same program in the same time leading to deadlock
Diffstat (limited to 'xmake/modules/lib/detect')
| -rw-r--r-- | xmake/modules/lib/detect/has_cxsnippets.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/modules/lib/detect/has_cxsnippets.lua b/xmake/modules/lib/detect/has_cxsnippets.lua index c00021bb9..233c43d83 100644 --- a/xmake/modules/lib/detect/has_cxsnippets.lua +++ b/xmake/modules/lib/detect/has_cxsnippets.lua @@ -185,6 +185,7 @@ function main(snippets, opt) -- make the source file local sourcefile = os.tmpfile() .. extension local objectfile = os.tmpfile() .. ".o" + local binaryfile = os.tmpfile() .. ".b" io.writefile(sourcefile, sourcecode) -- attempt to compile it @@ -193,7 +194,7 @@ function main(snippets, opt) function () compiler.compile(sourcefile, objectfile, opt) if #links > 0 then - linker.link("binary", {"cc", "cxx"}, objectfile, os.nuldev(), opt) + linker.link("binary", {"cc", "cxx"}, objectfile, binaryfile, opt) end return true end, @@ -210,6 +211,7 @@ function main(snippets, opt) -- remove some files os.tryrm(sourcefile) os.tryrm(objectfile) + os.tryrm(binaryfile) -- trace if opt.verbose or option.get("verbose") then |
