summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-26 20:01:10 +0800
committerOpportunityLiu <[email protected]>2019-06-26 20:01:10 +0800
commit318bb739dd64d19a4b4d91d8be49b22fc3403cff (patch)
tree738798d2645128ad516f9db0a02ea4c477e279b3 /xmake/core/base/os.lua
parent0dac0aec2688530d675d00df0debcd88226ff875 (diff)
improve tab complete
Diffstat (limited to 'xmake/core/base/os.lua')
-rw-r--r--xmake/core/base/os.lua26
1 files changed, 14 insertions, 12 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 09274450d..631276fca 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -788,28 +788,30 @@ end
-- get the system null device
function os.nuldev(input)
- -- init the output nuldev
- if xmake._NULDEV_OUTPUT == nil then
- if os.host() == "windows" then
- xmake._NULDEV_OUTPUT = "nul"
+ if os.host() == "windows" then
+ -- init the output nuldev
+ if xmake._NULDEV_OUTPUT == nil then
+ xmake._NULDEV_OUTPUT = os.tmpfile()
else
- xmake._NULDEV_OUTPUT = "/dev/null"
+ os.rm(xmake._NULDEV_OUTPUT)
end
- end
-
- -- init the input nuldev
- if xmake._NULDEV_INPUT == nil then
- if os.host() == "windows" then
+ -- init the input nuldev
+ if xmake._NULDEV_INPUT == nil then
-- create an empty file
--
-- for fix issue on mingw:
-- $ gcc -fopenmp -S -o nul -xc nul
-- gcc: fatal error:input file ‘nul’ is the same as output file
- --
+ --
local inputfile = os.tmpfile()
io.writefile(inputfile, "")
xmake._NULDEV_INPUT = inputfile
- else
+ end
+ else
+ if xmake._NULDEV_OUTPUT == nil then
+ xmake._NULDEV_OUTPUT = "/dev/null"
+ end
+ if xmake._NULDEV_INPUT == nil then
xmake._NULDEV_INPUT = "/dev/null"
end
end