summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/windres.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-08-18 22:45:41 +0800
committerruki <[email protected]>2023-08-18 22:45:41 +0800
commit2dcd6fc473ad17fac680b67dc84b10871192075e (patch)
treea877e1eb9165d832a8447a95edb8e7fa0552100c /xmake/modules/core/tools/windres.lua
parent82e5bf7afb748b6d3436e2bb114418432f574dc3 (diff)
improve windres #4075
Diffstat (limited to 'xmake/modules/core/tools/windres.lua')
-rw-r--r--xmake/modules/core/tools/windres.lua12
1 files changed, 3 insertions, 9 deletions
diff --git a/xmake/modules/core/tools/windres.lua b/xmake/modules/core/tools/windres.lua
index 2b306f110..a7940ce67 100644
--- a/xmake/modules/core/tools/windres.lua
+++ b/xmake/modules/core/tools/windres.lua
@@ -25,6 +25,7 @@ import("core.project.project")
-- init it
function init(self)
+ self:add("mrcflags", "--use-temp-file", "-O", "coff")
end
-- make the define flag
@@ -54,30 +55,23 @@ end
-- compile the source file
function compile(self, sourcefile, objectfile, dependinfo, flags)
-
- -- ensure the object directory
os.mkdir(path.directory(objectfile))
-
- -- compile it
try
{
function ()
- local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, flags))
+ local program, argv = compargv(self, sourcefile, objectfile, flags)
+ local outdata, errdata = os.iorunv(program, argv, {envs = self:runenvs()})
return (outdata or "") .. (errdata or "")
end,
catch
{
function (errors)
-
- -- compiling errors
os.raise(errors)
end
},
finally
{
function (ok, warnings)
-
- -- print some warnings
if warnings and #warnings > 0 and (option.get("diagnosis") or option.get("warning") or global.get("build_warning")) then
cprint("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n'))
end