]> git.ipfire.org Git - thirdparty/ccache.git/blobdiff - src/ccache.cpp
fix: Allow nonexistent include files in preprocessor mode
[thirdparty/ccache.git] / src / ccache.cpp
index c97e83c7369b4c2352ff39964be779cfb6c06947..d4bdb9c02837fa8d9375424ce395efde0402fe09 100644 (file)
@@ -352,7 +352,12 @@ remember_include_file(Context& ctx,
 
   DirEntry dir_entry(path, DirEntry::LogOnError::yes);
   if (!dir_entry.exists()) {
-    return tl::unexpected(Statistic::bad_input_file);
+    if (ctx.config.direct_mode()) {
+      LOG("Include file {} does not exist, disabling direct mode",
+          dir_entry.path());
+      ctx.config.set_direct_mode(false);
+    }
+    return {};
   }
   if (dir_entry.is_directory()) {
     // Ignore directory, typically $PWD.