Add --fatal flag to treat Premake script warnings as errors

This commit is contained in:
Jason Perkins 2014-05-09 15:17:00 -04:00
parent 5d38977c99
commit 9e372f8edb
2 changed files with 13 additions and 2 deletions

View File

@ -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"
}

View File

@ -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