Add warnOnce() helper method for add-on validation checks
This commit is contained in:
parent
09100182c3
commit
653bef99ca
@ -246,3 +246,20 @@
|
||||
function premake.warn(message, ...)
|
||||
io.stderr:write(string.format("** Warning: " .. message .. "\n", ...), 0)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Displays a warning just once per run.
|
||||
--
|
||||
-- @param message
|
||||
-- The warning message, which may contain string formatting tokens.
|
||||
-- @param ...
|
||||
-- Values to fill in the string formatting tokens.
|
||||
--
|
||||
|
||||
function premake.warnOnce(ctx, message, ...)
|
||||
if not ctx.warnings[message] then
|
||||
ctx.warnings[message] = true
|
||||
premake.warn(message, ...)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user