From fad51601972a3dd5d8e17f52fec2a70aea920b06 Mon Sep 17 00:00:00 2001 From: Tom van Dijck Date: Fri, 27 Mar 2015 11:19:13 -0700 Subject: [PATCH] add or bring back premake.action.supportsconfig --- src/base/action.lua | 16 ++++++++++++++++ src/base/oven.lua | 15 ++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/base/action.lua b/src/base/action.lua index a6e45d65..bebb5cf4 100644 --- a/src/base/action.lua +++ b/src/base/action.lua @@ -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 diff --git a/src/base/oven.lua b/src/base/oven.lua index 857fbdfd..a576e28c 100644 --- a/src/base/oven.lua +++ b/src/base/oven.lua @@ -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