summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/zig/has_flags.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-10 23:48:29 +0800
committerruki <[email protected]>2020-11-10 23:48:29 +0800
commit4de40c8e54d44e5f0d99efc6791b2ee5466156e2 (patch)
tree78d2676fb1b423cddc855629a913cae8f8ba09c5 /xmake/modules/detect/tools/zig/has_flags.lua
parent85aa5fce76f7dd92dc618a4ae1ef20579b5e5ccd (diff)
improve zig support for 0.7.0
Diffstat (limited to 'xmake/modules/detect/tools/zig/has_flags.lua')
-rw-r--r--xmake/modules/detect/tools/zig/has_flags.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/xmake/modules/detect/tools/zig/has_flags.lua b/xmake/modules/detect/tools/zig/has_flags.lua
index 1d8f8161b..0feecbe43 100644
--- a/xmake/modules/detect/tools/zig/has_flags.lua
+++ b/xmake/modules/detect/tools/zig/has_flags.lua
@@ -60,7 +60,7 @@ function _check_from_arglist(flags, opt, islinker)
-- get argument list
allflags = {}
- local arglist = os.iorunv(opt.program, {"--help"})
+ local arglist = os.iorunv(opt.program, {"build-obj", "--help"})
if arglist then
for arg in arglist:gmatch("%s+(%-[%-%a%d]+)%s+") do
allflags[arg] = true
@@ -81,13 +81,12 @@ function _check_try_running(flags, opt, islinker)
-- make an stub source file
local sourcefile = path.join(os.tmpdir(), "detect", "zig_has_flags.zig")
- local objectdir = path.join(os.tmpdir(), "detect", "zig_has_flags")
if not os.isfile(sourcefile) then
io.writefile(sourcefile, "pub fn main() !void {}")
end
-- init argv
- local argv = table.join(flags, "--output-dir", objectdir, sourcefile)
+ local argv = table.join(flags, "-femit-bin=" .. os.tmpfile(), sourcefile)
if islinker then
table.insert(argv, 1, "build-exe")
else