MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / writeDepFile

Function writeDepFile

StandAlone/StandAlone.cpp:1322–1338  ·  view source on GitHub ↗

Writes a depfile similar to gcc -MMD foo.c

Source from the content-addressed store, hash-verified

1320
1321// Writes a depfile similar to gcc -MMD foo.c
1322bool writeDepFile(std::string depfile, std::vector<std::string>& binaryFiles, const std::vector<std::string>& sources)
1323{
1324 std::ofstream file(depfile);
1325 if (file.fail())
1326 return false;
1327
1328 for (auto binaryFile = binaryFiles.begin(); binaryFile != binaryFiles.end(); binaryFile++) {
1329 writeEscapedDepString(file, *binaryFile);
1330 file << ":";
1331 for (auto sourceFile = sources.begin(); sourceFile != sources.end(); sourceFile++) {
1332 file << " ";
1333 writeEscapedDepString(file, *sourceFile);
1334 }
1335 file << std::endl;
1336 }
1337 return true;
1338}
1339
1340//
1341// For linking mode: Will independently parse each compilation unit, but then put them

Callers 1

Calls 3

writeEscapedDepStringFunction · 0.85
beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected