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

Method GenerateTarget

Source/cmGhsMultiTargetGenerator.cxx:117–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void 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
163cmGlobalGhsMultiGenerator* cmGhsMultiTargetGenerator::GetGlobalGenerator()
164 const

Callers 1

GenerateMethod · 0.95

Calls 15

GetGlobalGeneratorMethod · 0.95
WriteTargetSpecificsMethod · 0.95
SetCompilerFlagsMethod · 0.95
WriteCompilerFlagsMethod · 0.95
WriteIncludesMethod · 0.95
WriteTargetLinkLineMethod · 0.95
WriteBuildEventsMethod · 0.95
WriteSourcesMethod · 0.95
MessageClass · 0.85
GetLinkerTypePropertyMethod · 0.80
GetSupportDirectoryMethod · 0.80

Tested by

no test coverage detected