Skip to content

Commit 184722c

Browse files
committed
Don't fail importCompileCommands when source files are missing
1 parent 9b11b6b commit 184722c

3 files changed

Lines changed: 0 additions & 14 deletions

File tree

lib/importproject.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,6 @@ bool ImportProject::importCompileCommands(std::istream &istr)
430430
#endif
431431
else
432432
path = Path::simplifyPath(directory + file);
433-
if (!sourceFileExists(path)) {
434-
printError("'" + path + "' from compilation database does not exist");
435-
return false;
436-
}
437433
FileSettings fs{path, Standards::Language::None, 0}; // file will be identified later on
438434
fsParseCommand(fs, command); // read settings; -D, -I, -U, -std, -m*, -f*
439435
std::map<std::string, std::string, cppcheck::stricmp> variables;
@@ -1547,8 +1543,3 @@ void ImportProject::printError(const std::string &message)
15471543
{
15481544
std::cout << "cppcheck: error: " << message << std::endl;
15491545
}
1550-
1551-
bool ImportProject::sourceFileExists(const std::string &file)
1552-
{
1553-
return Path::isFile(file);
1554-
}

lib/importproject.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ class CPPCHECKLIB WARN_UNUSED ImportProject {
102102
protected:
103103
bool importCompileCommands(std::istream &istr);
104104
bool importCppcheckGuiProject(std::istream &istr, Settings &settings, Suppressions &supprs);
105-
virtual bool sourceFileExists(const std::string &file);
106105

107106
private:
108107
struct SharedItemsProject {

test/testimportproject.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ class TestImporter : public ImportProject {
3838
using ImportProject::importCppcheckGuiProject;
3939
using ImportProject::importVcxproj;
4040
using ImportProject::SharedItemsProject;
41-
42-
bool sourceFileExists(const std::string & /*file*/) override {
43-
return true;
44-
}
4541
};
4642

4743

0 commit comments

Comments
 (0)