Merge pull request #21 from Blizzard/pr15

add or bring back premake.action.supportsconfig
This commit is contained in:
starkos 2015-05-10 10:28:37 -04:00
commit 9a15907ef5
2 changed files with 28 additions and 3 deletions

View File

@ -230,3 +230,19 @@
end
return false
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
end
if action.supportsconfig then
return action.supportsconfig(cfg)
end
return true
end

View File

@ -177,7 +177,10 @@
local buildcfg = pairing[1]
local platform = pairing[2]
local cfg = oven.bakeConfig(self, buildcfg, platform)
self.configs[(buildcfg or "*") .. (platform or "")] = cfg
if premake.action.supportsconfig(premake.action.current(), cfg) then
self.configs[(buildcfg or "*") .. (platform or "")] = cfg
end
end
-- Process the sub-objects that are contained by this project. The
@ -295,10 +298,16 @@
for _, buildcfg in ipairs(buildcfgs) do
if #platforms > 0 then
for _, platform in ipairs(platforms) do
table.insert(configs, { ["buildcfg"] = buildcfg, ["platform"] = platform })
local cfg = { ["buildcfg"] = buildcfg, ["platform"] = platform }
if premake.action.supportsconfig(premake.action.current(), cfg) then
table.insert(configs, cfg)
end
end
else
table.insert(configs, { ["buildcfg"] = buildcfg })
local cfg = { ["buildcfg"] = buildcfg }
if premake.action.supportsconfig(premake.action.current(), cfg) then
table.insert(configs, cfg)
end
end
end