| 1088 | } |
| 1089 | |
| 1090 | bool 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 | |
| 1113 | cm::optional<std::set<std::string>> cmGlobalNinjaGenerator::ListSubsetWithAll( |
| 1114 | std::set<std::string> const& all, std::set<std::string> const& defaults, |
no test coverage detected