#!/usr/bin/c++script // Recompile all samples to make sure everything still compiles progdesc("Force compilation of all sample scripts"); option test ('t',"test","Do not compile the files",false,false); DIRNAME dir ("samples"); if (!dir.exist()){ cerr << "No sub-directory samples\n"; exit (1); } for (auto &file:dir.ls() | DIRNAME::drop_hidden() | nomatch("README")){ cout << format("File samples/{}\n",file.name); if (!test.val && system(format("COMPILE=on samples/{} --donotdoanything",file.name).c_str()) != 0){ cerr << format ("Compilation of file samples/{} failed\n",file.name); exit (1); } } return 0;