THRIFT-5800: Make non-exist include a failure when -strict is on
diff --git a/compiler/cpp/src/thrift/main.cc b/compiler/cpp/src/thrift/main.cc
index 5177076..56c5811 100644
--- a/compiler/cpp/src/thrift/main.cc
+++ b/compiler/cpp/src/thrift/main.cc
@@ -373,7 +373,12 @@
   }
 
   // Uh oh
-  pwarning(0, "Could not find include file %s\n", filename.c_str());
+  if (g_strict >= 192) {
+    // On strict mode this should be failure instead of warning
+    failure("Could not find include file %s", filename.c_str());
+  } else {
+    pwarning(0, "Could not find include file %s\n", filename.c_str());
+  }
   return std::string();
 }