From 4e8f9b62ce3aa5f1b2ad6ce8e24708d36e408c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Bispo?= Date: Fri, 7 Jun 2024 13:27:51 +0100 Subject: [PATCH] [ClangAstParser] Ignores include paths that do not exist, instead of throwing an exception --- .../up/fe/specs/clang/codeparser/ParallelCodeParser.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ClangAstParser/src/pt/up/fe/specs/clang/codeparser/ParallelCodeParser.java b/ClangAstParser/src/pt/up/fe/specs/clang/codeparser/ParallelCodeParser.java index e6cd8d3db..aebbb112b 100644 --- a/ClangAstParser/src/pt/up/fe/specs/clang/codeparser/ParallelCodeParser.java +++ b/ClangAstParser/src/pt/up/fe/specs/clang/codeparser/ParallelCodeParser.java @@ -481,7 +481,14 @@ private List getInputSourceFolders(List sources, List parser } if (isInclude) { - sourceFolders.add(SpecsIo.getCanonicalFile(SpecsIo.existingFolder(parserOption))); + var includePath = new File(parserOption); + + if (!includePath.exists()) { + SpecsLogs.info("Include path not found, ignoring: '" + parserOption + "'"); + } else { + sourceFolders.add(SpecsIo.getCanonicalFile(SpecsIo.existingFolder(parserOption))); + } + continue; } // if (parserOption.startsWith("-I")) {