From 3eb49baad4ca1ec338abb170279b1965be765913 Mon Sep 17 00:00:00 2001 From: tdijck Date: Wed, 25 Mar 2015 09:49:30 -0700 Subject: [PATCH] deprecate ReleaseRuntime flag, use 'runtime "Release"' instead.: --- src/_premake_init.lua | 18 +++++++++++++++++- src/base/config.lua | 7 +++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/_premake_init.lua b/src/_premake_init.lua index efd54758..57e296b6 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -403,7 +403,7 @@ "OptimizeSize", -- DEPRECATED "OptimizeSpeed", -- DEPRECATED "RelativeLinks", - "ReleaseRuntime", + "ReleaseRuntime", -- DEPRECATED "SEH", "ShadowedVariables", "StaticRuntime", @@ -630,6 +630,16 @@ } } + api.register { + name = "runtime", + scope = "config", + kind = "string", + allowed = { + "Debug", + "Release", + } + } + api.register { name = "pchheader", scope = "config", @@ -954,6 +964,12 @@ optimize "Off" end) + api.deprecateValue("flags", { "ReleaseRuntime" }, nil, + function(value) + runtime 'Release' + end, + function(value) + end) api.deprecateValue("flags", { "Optimise", "OptimiseSize", "OptimiseSpeed" }, nil, function(value) diff --git a/src/base/config.lua b/src/base/config.lua index 3644799f..37e87720 100755 --- a/src/base/config.lua +++ b/src/base/config.lua @@ -320,8 +320,11 @@ function config.getruntime(cfg) local linkage = iif(cfg.flags.StaticRuntime, "Static", "Shared") - local mode = iif(config.isDebugBuild(cfg) and not cfg.flags.ReleaseRuntime, "Debug", "Release") - return linkage .. mode + if (cfg.runtime == nil) then + return linkage .. iif(config.isDebugBuild(cfg), "Debug", "Release") + else + return linkage .. cfg.runtime + end end