Addons: try to create dump file in cppcheck build dir

This commit is contained in:
Daniel Marjamäki 2019-04-09 07:05:41 +02:00
parent 1f68e038be
commit cf6f886a68
1 changed files with 7 additions and 1 deletions

View File

@ -251,7 +251,13 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
std::ofstream fdump; std::ofstream fdump;
std::string dumpFile; std::string dumpFile;
if (mSettings.dump || !mSettings.addons.empty()) { if (mSettings.dump || !mSettings.addons.empty()) {
dumpFile = (mSettings.dumpFile.empty()) ? (filename + ".dump") : mSettings.dumpFile; if (!mSettings.dumpFile.empty())
dumpFile = mSettings.dumpFile;
else if (!mSettings.dump && !mSettings.buildDir.empty())
dumpFile = AnalyzerInformation::getAnalyzerInfoFile(mSettings.buildDir, filename, "") + ".dump";
else
dumpFile = filename + ".dump";
fdump.open(dumpFile); fdump.open(dumpFile);
if (fdump.is_open()) { if (fdump.is_open()) {
fdump << "<?xml version=\"1.0\"?>" << std::endl; fdump << "<?xml version=\"1.0\"?>" << std::endl;