Add --fatal flag to treat Premake script warnings as errors
This commit is contained in:
parent
5d38977c99
commit
9e372f8edb
@ -813,6 +813,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "fatal",
|
||||
description = "Treat warnings from project scripts as errors"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "file",
|
||||
@ -846,7 +852,7 @@
|
||||
newoption
|
||||
{
|
||||
trigger = "scripts",
|
||||
value = "path",
|
||||
value = "PATH",
|
||||
description = "Search for additional scripts on the given path"
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,12 @@
|
||||
--
|
||||
|
||||
function premake.warn(message, ...)
|
||||
io.stderr:write(string.format("** Warning: " .. message .. "\n", ...))
|
||||
message = string.format(message, ...)
|
||||
if _OPTIONS.fatal then
|
||||
error(message)
|
||||
else
|
||||
io.stderr:write(string.format("** Warning: " .. message .. "\n", ...))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user