diff --git a/Makefile b/Makefile index 59988cc63..6dfbe39d4 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/cli/cli.pro b/cli/cli.pro index e04e4e158..2195098de 100644 --- a/cli/cli.pro +++ b/cli/cli.pro @@ -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) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index d89329e76..d8f61bab5 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -28,8 +28,10 @@ #include "path.h" #include "filelister.h" +#ifdef HAVE_DEPENDENCIES // xml is used in rules #include +#endif static void AddFilesToList(const std::string& FileList, std::vector& 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) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 7530498a7..9f3d81320 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -30,7 +30,7 @@ #include #include "timer.h" -#ifndef __BORLANDC__ +#ifdef HAVE_DEPENDENCIES #define PCRE_STATIC #include #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()) { diff --git a/tools/dmake.cpp b/tools/dmake.cpp index ea7cdcb34..88aa47159 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -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 "