MCPcopy Create free account
hub / github.com/Kitware/CMake / OpenFileStream

Method OpenFileStream

Source/cmGlobalNinjaGenerator.cxx:1090–1111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1088}
1089
1090bool cmGlobalNinjaGenerator::OpenFileStream(
1091 std::unique_ptr<cmGeneratedFileStream>& stream, std::string const& name)
1092{
1093 // Get a stream where to generate things.
1094 if (!stream) {
1095 // Compute Ninja's build file path.
1096 std::string path =
1097 cmStrCat(this->GetCMakeInstance()->GetHomeOutputDirectory(), '/', name);
1098 stream = cm::make_unique<cmGeneratedFileStream>(
1099 path, false, this->GetMakefileEncoding());
1100 if (!(*stream)) {
1101 // An error message is generated by the constructor if it cannot
1102 // open the file.
1103 return false;
1104 }
1105
1106 // Write the do not edit header.
1107 this->WriteDisclaimer(*stream);
1108 }
1109
1110 return true;
1111}
1112
1113cm::optional<std::set<std::string>> cmGlobalNinjaGenerator::ListSubsetWithAll(
1114 std::set<std::string> const& all, std::set<std::string> const& defaults,

Callers 2

OpenBuildFileStreamsMethod · 0.95
OpenRulesFileStreamMethod · 0.95

Calls 4

GetMakefileEncodingMethod · 0.95
WriteDisclaimerMethod · 0.95
cmStrCatFunction · 0.70
GetCMakeInstanceMethod · 0.45

Tested by

no test coverage detected