From 3e4ba898c17c5366e42c317dc73bf94954ec8d68 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 21 Jun 2011 15:59:10 -0400 Subject: [PATCH] Only pay for unused variable checking if it is on. --- Source/cmMakefile.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 63bf03bdd..014ef6793 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1759,6 +1759,10 @@ void cmMakefile::AddDefinition(const char* name, bool value) void cmMakefile::CheckForUnusedVariables() const { + if (!this->WarnUnused) + { + return; + } const cmDefinitions& defs = this->Internal->VarStack.top(); const std::set& locals = defs.LocalKeys(); std::set::const_iterator it = locals.begin();