| 115 | } |
| 116 | |
| 117 | void cmGhsMultiTargetGenerator::GenerateTarget() |
| 118 | { |
| 119 | if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE && |
| 120 | !this->GeneratorTarget |
| 121 | ->GetLinkerTypeProperty( |
| 122 | this->GeneratorTarget->GetLinkerLanguage(this->ConfigName), |
| 123 | this->ConfigName) |
| 124 | .empty()) { |
| 125 | // Green Hill MULTI does not support this feature. |
| 126 | cmSystemTools::Message( |
| 127 | cmStrCat("'LINKER_TYPE' property, specified on target '", |
| 128 | this->GeneratorTarget->GetName(), |
| 129 | "', is not supported by this generator.")); |
| 130 | } |
| 131 | |
| 132 | // Open the target file in copy-if-different mode. |
| 133 | std::string fproj = |
| 134 | cmStrCat(this->GeneratorTarget->GetSupportDirectory(), '/', this->Name, |
| 135 | cmGlobalGhsMultiGenerator::FILE_EXTENSION); |
| 136 | |
| 137 | // Tell the global generator the name of the project file |
| 138 | this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME", fproj); |
| 139 | this->GeneratorTarget->Target->SetProperty( |
| 140 | "GENERATOR_FILE_NAME_EXT", GhsMultiGpj::GetGpjTag(this->TagType)); |
| 141 | |
| 142 | cmGeneratedFileStream fout(fproj); |
| 143 | fout.SetCopyIfDifferent(true); |
| 144 | |
| 145 | this->GetGlobalGenerator()->WriteFileHeader(fout); |
| 146 | GhsMultiGpj::WriteGpjTag(this->TagType, fout); |
| 147 | |
| 148 | if (this->TagType != GhsMultiGpj::CUSTOM_TARGET) { |
| 149 | std::string const language( |
| 150 | this->GeneratorTarget->GetLinkerLanguage(this->ConfigName)); |
| 151 | this->WriteTargetSpecifics(fout, this->ConfigName); |
| 152 | this->SetCompilerFlags(this->ConfigName, language); |
| 153 | this->WriteCompilerFlags(fout, this->ConfigName, language); |
| 154 | this->WriteCompilerDefinitions(fout, this->ConfigName, language); |
| 155 | this->WriteIncludes(fout, this->ConfigName, language); |
| 156 | this->WriteTargetLinkLine(fout, this->ConfigName); |
| 157 | this->WriteBuildEvents(fout); |
| 158 | } |
| 159 | this->WriteSources(fout); |
| 160 | fout.Close(); |
| 161 | } |
| 162 | |
| 163 | cmGlobalGhsMultiGenerator* cmGhsMultiTargetGenerator::GetGlobalGenerator() |
| 164 | const |
no test coverage detected