diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2010-08-24 20:49:49 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2010-09-01 17:08:14 (GMT) |
commit | d3e8eb504137dde90a73f1b46f97f889af46db18 (patch) | |
tree | cae1d614efc1acbe7a0efc284d6e1c7fadcf8cc6 /Source/cmake.cxx | |
parent | f332e14ff2035e33bced0915373296a1f4cf0876 (diff) | |
download | CMake-d3e8eb504137dde90a73f1b46f97f889af46db18.zip CMake-d3e8eb504137dde90a73f1b46f97f889af46db18.tar.gz CMake-d3e8eb504137dde90a73f1b46f97f889af46db18.tar.bz2 |
Add flags to detect unused variables
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2e77748..41f2775 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -141,6 +141,8 @@ cmake::cmake() { this->Trace = false; this->StrictMode = false; + this->FindUnused = false; + this->DefaultToUsed = false; this->SuppressDevWarnings = false; this->DoSuppressDevWarnings = false; this->DebugOutput = false; @@ -619,6 +621,18 @@ void cmake::SetArgs(const std::vector<std::string>& args) std::cout << "Running in strict mode.\n"; this->SetStrictMode(true); } + else if(arg.find("--find-unused",0) == 0) + { + std::cout << "Finding unused command line variables.\n"; + this->SetFindUnused(true); + this->SetDefaultToUsed(true); + } + else if(arg.find("--find-unused-all",0) == 0) + { + std::cout << "Finding unused variables.\n"; + this->SetFindUnused(true); + this->SetDefaultToUsed(false); + } else if(arg.find("-G",0) == 0) { std::string value = arg.substr(2); |