add nil check, remove 'self' as argument, just get it through action.current()

This commit is contained in:
Tom van Dijck 2015-05-21 09:01:51 -07:00
parent 7ce257badc
commit 53e4145765
2 changed files with 13 additions and 5 deletions

View File

@ -214,7 +214,11 @@
-- True if the feature is supported, false otherwise.
---
function action.supports(self, feature)
function action.supports(feature)
if not feature then
return true
end
local self = action.current()
if not self then
return false
end
@ -232,11 +236,11 @@
end
--
--
-- Determines if an action supports a particular configuration.
-- @return
-- True if the configuration is supported, false otherwise.
--
--
function premake.action.supportsconfig(action, cfg)
if not action then
return false

View File

@ -117,11 +117,15 @@
function p.project.bake(self)
local sln = self.solution
if not premake.action.supports(premake.action.current(), self.language) then
-- check if the language for this project is supported by the action.
if not p.action.supports(self.language) then
printf(" Unsupported language '%s' used for '%s'.", self.language, self.name)
end
if not premake.action.supports(premake.action.current(), self.kind) then
-- check if the kind for this project is supported by the action.
if not p.action.supports(self.kind) then
printf(" Unsupported kind '%s' used for '%s'.", self.kind, self.name)
end