summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-04-17 14:43:56 +0800
committerruki <[email protected]>2017-04-17 14:43:56 +0800
commit1329aeb4e956262342acf713ad9d14ad18ce3352 (patch)
treebb06cbc95661f413e92d2a656242158f163c95e9
parent01c4183901255ab4938f8b5ad2aaacec0cee0973 (diff)
fix tmpfile path bug
-rw-r--r--xmake/platforms/iphoneos/check.lua2
-rw-r--r--xmake/platforms/watchos/check.lua2
-rw-r--r--xmake/platforms/windows/check.lua4
-rw-r--r--xmake/tools/ar.lua6
4 files changed, 7 insertions, 7 deletions
diff --git a/xmake/platforms/iphoneos/check.lua b/xmake/platforms/iphoneos/check.lua
index 2e5b050d4..f95785e4c 100644
--- a/xmake/platforms/iphoneos/check.lua
+++ b/xmake/platforms/iphoneos/check.lua
@@ -30,7 +30,7 @@ import("platforms.checker", {rootdir = os.programdir()})
function _check_as(shellname)
-- make an empty tmp.S
- local tmpfile = path.join(os.tmpdir(), "xmake.checker.as.S")
+ local tmpfile = os.tmpfile() .. ".S"
io.writefile(tmpfile, "")
-- check it
diff --git a/xmake/platforms/watchos/check.lua b/xmake/platforms/watchos/check.lua
index 38963a4e6..29c708e83 100644
--- a/xmake/platforms/watchos/check.lua
+++ b/xmake/platforms/watchos/check.lua
@@ -30,7 +30,7 @@ import("platforms.checker", {rootdir = os.programdir()})
function _check_as(shellname)
-- make an empty tmp.S
- local tmpfile = path.join(os.tmpdir(), "xmake.checker.as.S")
+ local tmpfile = os.tmpfile() .. ".S"
io.writefile(tmpfile, "")
-- check it
diff --git a/xmake/platforms/windows/check.lua b/xmake/platforms/windows/check.lua
index f37b324bf..cb7e78eb1 100644
--- a/xmake/platforms/windows/check.lua
+++ b/xmake/platforms/windows/check.lua
@@ -90,8 +90,8 @@ function _apply_vsenv(config, vs)
end
-- make the genvcvars.bat
- local genvcvars_bat = path.join(os.tmpdir(), "xmake.genvcvars.bat")
- local genvcvars_dat = path.join(os.tmpdir(), "xmake.genvcvars.dat")
+ local genvcvars_bat = os.tmpfile() .. "_genvcvars.bat"
+ local genvcvars_dat = os.tmpfile() .. "_genvcvars.dat"
local file = io.open(genvcvars_bat, "w")
file:print("@echo off")
file:print("call \"%s\" %s > nul", vcvarsall, config.get("arch"))
diff --git a/xmake/tools/ar.lua b/xmake/tools/ar.lua
index 281055c40..e870aa866 100644
--- a/xmake/tools/ar.lua
+++ b/xmake/tools/ar.lua
@@ -116,9 +116,9 @@ end
function check(flags)
-- make an stub source file
- local libraryfile = path.join(os.tmpdir(), "xmake.ar.a")
- local objectfile = path.join(os.tmpdir(), "xmake.ar.o")
- local sourcefile = path.join(os.tmpdir(), "xmake.ar.c")
+ local libraryfile = os.tmpfile() .. ".a"
+ local objectfile = os.tmpfile() .. ".o"
+ local sourcefile = os.tmpfile() .. ".c"
io.writefile(sourcefile, "int test(void)\n{return 0;}")
-- make flags