File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,33 @@ int main(int argc, char **argv)
9191 return 1 ;
9292 }
9393
94+ // TODO: move this logic into simplecpp?
95+ {
96+ bool inc_missing = false ;
97+ for (const std::string& inc : dui.includes ) {
98+ std::ifstream f (inc);
99+ if (!f.is_open ()) {
100+ inc_missing = true ;
101+ std::cout << " error: could not open include '" << inc << " '" << std::endl;
102+ }
103+ }
104+ if (inc_missing)
105+ return 1 ;
106+ }
107+ {
108+ bool inc_missing = false ;
109+ for (const std::string& inc : dui.includePaths ) {
110+ // TODO: check if this is a directory
111+ std::ifstream f (inc);
112+ if (!f.is_open ()) {
113+ inc_missing = true ;
114+ std::cout << " error: could not find include path '" << inc << " '" << std::endl;
115+ }
116+ }
117+ if (inc_missing)
118+ return 1 ;
119+ }
120+
94121 if (!filename) {
95122 std::cout << " Syntax:" << std::endl;
96123 std::cout << " simplecpp [options] filename" << std::endl;
You can’t perform that action at this time.
0 commit comments