diff options
| author | ruki <[email protected]> | 2023-02-15 22:46:13 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-02-15 22:46:13 +0800 |
| commit | e288951c41b72f3ccf3cfed495417fea7dee1e79 (patch) | |
| tree | 085099794d03376e60680ae594697a3669f6fbf5 /xmake/modules/detect/tools/cl/has_flags.lua | |
| parent | 0936ad49411c55cf4130793750336e011366ebbf (diff) | |
add snippet to has_flags
Diffstat (limited to 'xmake/modules/detect/tools/cl/has_flags.lua')
| -rw-r--r-- | xmake/modules/detect/tools/cl/has_flags.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/modules/detect/tools/cl/has_flags.lua b/xmake/modules/detect/tools/cl/has_flags.lua index fe57e38b0..e1e986303 100644 --- a/xmake/modules/detect/tools/cl/has_flags.lua +++ b/xmake/modules/detect/tools/cl/has_flags.lua @@ -54,10 +54,10 @@ end function _check_try_running(flags, opt) -- make an stub source file - local tmpdir = path.join(os.tmpdir(), "detect") - local sourcefile = path.join(tmpdir, "cl_has_flags" .. _get_extension(opt)) + local snippet = opt.snippet or "int main(int argc, char** argv)\n{return 0;}" + local sourcefile = os.tmpfile("cl_has_flags:" .. snippet) .. _get_extension(opt) if not os.isfile(sourcefile) then - io.writefile(sourcefile, "int main(int argc, char** argv)\n{return 0;}") + io.writefile(sourcefile, snippet) end -- check it |
