cppcheck: Added HAVE_DEPENDENCIES define. Cppcheck cli can be compiled without dependencies.

This commit is contained in:
Daniel Marjamäki 2011-02-12 08:06:59 +01:00
parent 78b5361ec8
commit 27febb062b
5 changed files with 10 additions and 4 deletions

View File

@ -1,7 +1,7 @@
# This file is generated by tools/dmake, do not edit.
ifndef CXXFLAGS
CXXFLAGS=-Wall -Wextra -Wshadow -pedantic -Wno-long-long -Wfloat-equal -Wcast-qual -Wsign-conversion -g
CXXFLAGS=-DHAVE_DEPENDENCIES -Wall -Wextra -Wshadow -pedantic -Wno-long-long -Wfloat-equal -Wcast-qual -Wsign-conversion -g
endif
ifndef CXX

View File

@ -5,6 +5,7 @@ INCLUDEPATH += . ../lib
OBJECTS_DIR = temp
CONFIG += warn_on
CONFIG -= qt app_bundle
DEFINES += HAVE_DEPENDENCIES
BASEPATH = ../externals/tinyxml/
include($$PWD/../externals/tinyxml/tinyxml.pri)

View File

@ -28,8 +28,10 @@
#include "path.h"
#include "filelister.h"
#ifdef HAVE_DEPENDENCIES
// xml is used in rules
#include <tinyxml.h>
#endif
static void AddFilesToList(const std::string& FileList, std::vector<std::string>& PathNames)
{
@ -503,6 +505,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
_settings->_showtime = SHOWTIME_NONE;
}
#ifdef HAVE_DEPENDENCIES
// Rule given at command line
else if (strncmp(argv[i], "--rule=", 7) == 0)
{
@ -549,6 +552,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
}
}
}
#endif
// Print help
else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)

View File

@ -30,7 +30,7 @@
#include <ctime>
#include "timer.h"
#ifndef __BORLANDC__
#ifdef HAVE_DEPENDENCIES
#define PCRE_STATIC
#include <pcre.h>
#endif
@ -309,7 +309,7 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
(*it)->runSimplifiedChecks(&_tokenizer, &_settings, this);
}
#ifndef __BORLANDC__
#ifdef HAVE_DEPENDENCIES
// Are there extra rules?
if (!_settings.rules.empty())
{

View File

@ -225,7 +225,7 @@ int main(int argc, char **argv)
// Makefile settings..
if (release)
{
makeConditionalVariable(fout, "CXXFLAGS", "-O2 -DNDEBUG -Wall");
makeConditionalVariable(fout, "CXXFLAGS", "-O2 -DNDEBUG -DHAVE_DEPENDENCIES -Wall");
}
else
{
@ -235,6 +235,7 @@ int main(int argc, char **argv)
// The _GLIBCXX_DEBUG doesn't work in cygwin
makeConditionalVariable(fout, "CXXFLAGS",
"-DHAVE_DEPENDENCIES "
"-Wall "
"-Wextra "
"-Wshadow "