summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/nvcc/has_flags.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/detect/tools/nvcc/has_flags.lua')
-rw-r--r--xmake/modules/detect/tools/nvcc/has_flags.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/modules/detect/tools/nvcc/has_flags.lua b/xmake/modules/detect/tools/nvcc/has_flags.lua
index d96ffdfe8..c75f6e114 100644
--- a/xmake/modules/detect/tools/nvcc/has_flags.lua
+++ b/xmake/modules/detect/tools/nvcc/has_flags.lua
@@ -101,13 +101,13 @@ end
function _check_try_running(flags, opt, islinker)
-- make an stub source file
- local sourcefile = path.join(os.tmpdir(), "detect", "nvcc_has_flags.cu")
+ local snippet = opt.snippet or "int main(int argc, char** argv)\n{return 0;}"
+ local sourcefile = os.tmpfile("nvcc_has_flags:" .. snippet) .. ".cu"
if not os.isfile(sourcefile) then
- io.writefile(sourcefile, "int main(int argc, char** argv)\n{return 0;}")
+ io.writefile(sourcefile, snippet)
end
local args = table.join("-o", os.nuldev(), sourcefile)
-
if not islinker then
table.insert(args, 1, "-c")
end