Add NoWarnings flags for Visual Studo to disable warnings (Very usefull when managing 3rd libraries).
This commit is contained in:
parent
86984a87de
commit
bd16eaedeb
@ -286,15 +286,21 @@
|
||||
_p(4,'UsePrecompiledHeader="%s"', iif(_ACTION > "vs2003" or cfg.flags.NoPCH, 0, 2))
|
||||
end
|
||||
|
||||
_p(4,'WarningLevel="%s"', iif(cfg.flags.ExtraWarnings, 4, 3))
|
||||
|
||||
if cfg.flags.FatalWarnings then
|
||||
_p(4,'WarnAsError="%s"', bool(true))
|
||||
if cfg.flags.NoWarnings then
|
||||
_p(4,'WarningLevel="0"')
|
||||
else
|
||||
_p(4,'WarningLevel="%s"', iif(cfg.flags.ExtraWarnings, 4, 3))
|
||||
|
||||
if cfg.flags.FatalWarnings then
|
||||
_p(4,'WarnAsError="%s"', bool(true))
|
||||
end
|
||||
|
||||
if _ACTION < "vs2008" and not cfg.flags.Managed then
|
||||
_p(4,'Detect64BitPortabilityProblems="%s"', bool(not cfg.flags.No64BitChecks))
|
||||
end
|
||||
end
|
||||
|
||||
if _ACTION < "vs2008" and not cfg.flags.Managed then
|
||||
_p(4,'Detect64BitPortabilityProblems="%s"', bool(not cfg.flags.No64BitChecks))
|
||||
end
|
||||
|
||||
|
||||
_x(4,'ProgramDataBaseFileName="$(OutDir)\\%s.pdb"', config.gettargetinfo(cfg).basename)
|
||||
|
||||
@ -1202,14 +1208,18 @@
|
||||
_p(4,'UsePrecompiledHeader="%s"', iif(_ACTION > "vs2003" or cfg.flags.NoPCH, 0, 2))
|
||||
end
|
||||
|
||||
_p(4,'WarningLevel="%s"', iif(cfg.flags.ExtraWarnings, 4, 3))
|
||||
|
||||
if cfg.flags.FatalWarnings then
|
||||
_p(4,'WarnAsError="%s"', bool(true))
|
||||
end
|
||||
|
||||
if _ACTION < "vs2008" and not cfg.flags.Managed then
|
||||
_p(4,'Detect64BitPortabilityProblems="%s"', bool(not cfg.flags.No64BitChecks))
|
||||
if cfg.flags.NoWarnings then
|
||||
_p(4,'WarningLevel="0"')
|
||||
else
|
||||
_p(4,'WarningLevel="%s"', iif(cfg.flags.ExtraWarnings, 4, 3))
|
||||
|
||||
if cfg.flags.FatalWarnings then
|
||||
_p(4,'WarnAsError="%s"', bool(true))
|
||||
end
|
||||
|
||||
if _ACTION < "vs2008" and not cfg.flags.Managed then
|
||||
_p(4,'Detect64BitPortabilityProblems="%s"', bool(not cfg.flags.No64BitChecks))
|
||||
end
|
||||
end
|
||||
|
||||
_p(4,'ProgramDataBaseFileName="$(OutDir)\\%s.pdb"', path.getbasename(cfg.buildtarget.name))
|
||||
|
@ -202,15 +202,21 @@
|
||||
_p(3,'<PrecompiledHeader>NotUsing</PrecompiledHeader>')
|
||||
end
|
||||
|
||||
_p(3,'<WarningLevel>Level%d</WarningLevel>', iif(cfg.flags.ExtraWarnings, 4, 3))
|
||||
if cfg.flags.NoWarnings then
|
||||
_p(3,'<WarningLevel>Level0</WarningLevel>')
|
||||
else
|
||||
_p(3,'<WarningLevel>Level%d</WarningLevel>', iif(cfg.flags.ExtraWarnings, 4, 3))
|
||||
|
||||
if premake.config.isdebugbuild(cfg) and cfg.flags.ExtraWarnings then
|
||||
_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')
|
||||
if premake.config.isdebugbuild(cfg) and cfg.flags.ExtraWarnings then
|
||||
_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')
|
||||
end
|
||||
|
||||
if cfg.flags.FatalWarnings then
|
||||
_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')
|
||||
end
|
||||
end
|
||||
|
||||
if cfg.flags.FatalWarnings then
|
||||
_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')
|
||||
end
|
||||
|
||||
|
||||
vc2010.preprocessorDefinitions(cfg.defines)
|
||||
vc2010.additionalIncludeDirectories(cfg, cfg.includedirs)
|
||||
@ -910,7 +916,7 @@
|
||||
_p(3,'<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')
|
||||
end
|
||||
|
||||
if cfg.flags.ExtraWarnings then
|
||||
if not cfg.flags.NoWarnings and cfg.flags.ExtraWarnings then
|
||||
_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')
|
||||
end
|
||||
else
|
||||
@ -923,14 +929,18 @@
|
||||
|
||||
precompiled_header(cfg)
|
||||
|
||||
if cfg.flags.ExtraWarnings then
|
||||
_p(3,'<WarningLevel>Level4</WarningLevel>')
|
||||
if cfg.flags.NoWarnings then
|
||||
_p(3,'<WarningLevel>Level0</WarningLevel>')
|
||||
else
|
||||
_p(3,'<WarningLevel>Level3</WarningLevel>')
|
||||
end
|
||||
if cfg.flags.ExtraWarnings then
|
||||
_p(3,'<WarningLevel>Level4</WarningLevel>')
|
||||
else
|
||||
_p(3,'<WarningLevel>Level3</WarningLevel>')
|
||||
end
|
||||
|
||||
if cfg.flags.FatalWarnings then
|
||||
_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')
|
||||
if cfg.flags.FatalWarnings then
|
||||
_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')
|
||||
end
|
||||
end
|
||||
|
||||
exceptions(cfg)
|
||||
|
@ -262,6 +262,7 @@
|
||||
"NoNativeWChar",
|
||||
"NoPCH",
|
||||
"NoRTTI",
|
||||
"NoWarnings",
|
||||
"Optimize",
|
||||
"OptimizeSize",
|
||||
"OptimizeSpeed",
|
||||
|
@ -81,6 +81,33 @@
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- If the NoWarnings flag is specified, mute on warnings.
|
||||
--
|
||||
|
||||
function suite.warningLevel_onNoWarnings()
|
||||
flags "NoWarnings"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level0</WarningLevel>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- NoWarnings disables ExtraWarnings FatalWarnings flagss.
|
||||
--
|
||||
|
||||
function suite.warningLevel_onNoWarningsOverOtherWarningsFlags()
|
||||
flags { "NoWarnings", "ExtraWarnings", "FatalWarnings" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level0</WarningLevel>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- Check the optimization flags.
|
||||
|
Loading…
Reference in New Issue
Block a user