Replace "Off" string literal with p.OFF variable, just in case

This commit is contained in:
Jason Perkins 2014-11-11 19:29:28 -05:00
parent ca68cc052b
commit baa6989d0f
3 changed files with 26 additions and 23 deletions

View File

@ -751,7 +751,7 @@
-- Edit-and-continue doesn't work for some configurations
if not cfg.editAndContinue or
config.isOptimizedBuild(cfg) or
cfg.clr ~= "Off" or
cfg.clr ~= p.OFF or
cfg.system == "x64"
then
return 3
@ -922,7 +922,7 @@
local cfg, filecfg = config.normalize(cfg)
if not filecfg
and not config.isOptimizedBuild(cfg)
and cfg.clr == "Off"
and cfg.clr == p.OFF
and not cfg.flags.NoRuntimeChecks
then
p.w('BasicRuntimeChecks="3"')
@ -1062,7 +1062,7 @@
function m.detect64BitPortabilityProblems(cfg)
local prjcfg, filecfg = config.normalize(cfg)
if _ACTION < "vs2008" and cfg.clr == "Off" and cfg.warnings ~= "Off" and not filecfg then
if _ACTION < "vs2008" and cfg.clr == p.OFF and cfg.warnings ~= p.OFF and not filecfg then
p.w('Detect64BitPortabilityProblems="%s"', tostring(not cfg.flags.No64BitChecks))
end
end
@ -1164,7 +1164,7 @@
local windows, managed, makefile
for cfg in project.eachconfig(prj) do
if cfg.system == p.WINDOWS then windows = true end
if cfg.clr ~= "Off" then managed = true end
if cfg.clr ~= p.OFF then managed = true end
if vstudio.isMakefile(cfg) then makefile = true end
end
@ -1261,7 +1261,7 @@
function m.managedExtensions(cfg)
if cfg.clr ~= "Off" then
if cfg.clr ~= p.OFF then
p.w('ManagedExtensions="1"')
end
end
@ -1272,7 +1272,7 @@
if config.isDebugBuild(cfg) and
cfg.debugformat ~= "c7" and
not cfg.flags.NoMinimalRebuild and
cfg.clr == "Off" and
cfg.clr == p.OFF and
not cfg.flags.MultiProcessorCompile
then
p.w('MinimalRebuild="true"')
@ -1500,7 +1500,7 @@
function m.runtimeTypeInfo(cfg)
if cfg.flags.NoRTTI and cfg.clr == "Off" then
if cfg.flags.NoRTTI and cfg.clr == p.OFF then
p.w('RuntimeTypeInfo="false"')
end
end
@ -1607,7 +1607,7 @@
function m.warnAsError(cfg)
if cfg.flags.FatalCompileWarnings and cfg.warnings ~= "Off" then
if cfg.flags.FatalCompileWarnings and cfg.warnings ~= p.OFF then
p.w('WarnAsError="true"')
end
end
@ -1618,7 +1618,7 @@
local prjcfg, filecfg = config.normalize(cfg)
local level
if cfg.warnings == "Off" then
if cfg.warnings == p.OFF then
level = "0"
elseif cfg.warnings == "Extra" then
level = "4"

View File

@ -817,7 +817,7 @@
--
m.elements.projectReferences = function(prj, ref)
if prj.clr ~= "Off" then
if prj.clr ~= p.OFF then
return {
m.referenceProject,
m.referencePrivate,
@ -951,7 +951,7 @@
function m.clrSupport(cfg)
if cfg.clr ~= "Off" then
if cfg.clr ~= p.OFF then
_p(2,'<CLRSupport>true</CLRSupport>')
end
end
@ -992,7 +992,7 @@
if cfg.debugformat == "c7" then
value = "OldStyle"
elseif cfg.architecture == "x64" or
cfg.clr ~= "Off" or
cfg.clr ~= p.OFF or
config.isOptimizedBuild(cfg) or
not cfg.editAndContinue
then
@ -1039,7 +1039,7 @@
function m.entryPointSymbol(cfg)
if (cfg.kind == premake.CONSOLEAPP or cfg.kind == premake.WINDOWEDAPP) and
not cfg.flags.WinMain and
cfg.clr == "Off" and
cfg.clr == p.OFF and
cfg.system ~= premake.XBOX360
then
_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')
@ -1210,7 +1210,7 @@
if cfg.system == premake.WINDOWS then
isWin = true
end
if cfg.clr ~= "Off" then
if cfg.clr ~= p.OFF then
isManaged = true
end
if vstudio.isMakefile(cfg) then
@ -1484,7 +1484,7 @@
function m.runtimeTypeInfo(cfg)
if cfg.flags.NoRTTI and cfg.clr == "Off" then
if cfg.flags.NoRTTI and cfg.clr == p.OFF then
_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')
end
end
@ -1544,7 +1544,7 @@
function m.treatWarningAsError(cfg)
if cfg.flags.FatalCompileWarnings and cfg.warnings ~= "Off" then
if cfg.flags.FatalCompileWarnings and cfg.warnings ~= p.OFF then
p.w('<TreatWarningAsError>true</TreatWarningAsError>')
end
end

View File

@ -4,9 +4,12 @@
-- Copyright (c) 2011-2013 Jason Perkins and the Premake project
--
premake.config = {}
local project = premake.project
local config = premake.config
local p = premake
p.config = {}
local project = p.project
local config = p.config
---
@ -91,8 +94,8 @@
-- Can't link managed and unmanaged projects
local cfgManaged = project.isdotnet(cfg.project) or (cfg.clr ~= "Off")
local tgtManaged = project.isdotnet(target.project) or (target.clr ~= "Off")
local cfgManaged = project.isdotnet(cfg.project) or (cfg.clr ~= p.OFF)
local tgtManaged = project.isdotnet(target.project) or (target.clr ~= p.OFF)
return (cfgManaged == tgtManaged)
end
@ -111,7 +114,7 @@
-- Unmanaged projects can never link managed assemblies
if isManaged and cfg.clr == "Off" then
if isManaged and cfg.clr == p.OFF then
return false
end
@ -438,7 +441,7 @@
--
function config.isOptimizedBuild(cfg)
return cfg.optimize ~= nil and cfg.optimize ~= "Off" and cfg.optimize ~= "Debug"
return cfg.optimize ~= nil and cfg.optimize ~= p.OFF and cfg.optimize ~= "Debug"
end