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

Function writeEscapedDepString

StandAlone/StandAlone.cpp:1301–1319  ·  view source on GitHub ↗

Writes a string into a depfile, escaping some special characters following the Makefile rules.

Source from the content-addressed store, hash-verified

1299
1300// Writes a string into a depfile, escaping some special characters following the Makefile rules.
1301static void writeEscapedDepString(std::ofstream& file, const std::string& str)
1302{
1303 for (char c : str) {
1304 switch (c) {
1305 case ' ':
1306 case ':':
1307 case '#':
1308 case '[':
1309 case ']':
1310 case '\\':
1311 file << '\\';
1312 break;
1313 case '$':
1314 file << '$';
1315 break;
1316 }
1317 file << c;
1318 }
1319}
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)

Callers 1

writeDepFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected