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

Method CreateUtilityOutput

Source/cmLocalNinjaGenerator.cxx:785–810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

783}
784
785std::string cmLocalNinjaGenerator::CreateUtilityOutput(
786 std::string const& targetName, std::vector<std::string> const& byproducts,
787 cmListFileBacktrace const& bt)
788{
789 // In Ninja Multi-Config, we can only produce cross-config utility
790 // commands if all byproducts are per-config.
791 if (!this->GetGlobalGenerator()->IsMultiConfig() ||
792 !this->HasUniqueByproducts(byproducts, bt)) {
793 return this->cmLocalGenerator::CreateUtilityOutput(targetName, byproducts,
794 bt);
795 }
796
797 std::string const base = cmStrCat(this->GetCurrentBinaryDirectory(),
798 "/CMakeFiles/", targetName, '-');
799 // The output is not actually created so mark it symbolic.
800 for (std::string const& config : this->GetConfigNames()) {
801 std::string const force = cmStrCat(base, config);
802 if (cmSourceFile* sf = this->Makefile->GetOrCreateGeneratedSource(force)) {
803 sf->SetProperty("SYMBOLIC", "1");
804 } else {
805 cmSystemTools::Error("Could not get source file entry for " + force);
806 }
807 }
808 this->GetGlobalNinjaGenerator()->AddPerConfigUtilityTarget(targetName);
809 return cmStrCat(base, "$<CONFIG>"_s);
810}
811
812std::vector<cmCustomCommandGenerator>
813cmLocalNinjaGenerator::MakeCustomCommandGenerators(

Callers

nothing calls this directly

Calls 9

HasUniqueByproductsMethod · 0.95
cmStrCatFunction · 0.70
ErrorClass · 0.70
IsMultiConfigMethod · 0.45
GetGlobalGeneratorMethod · 0.45
SetPropertyMethod · 0.45

Tested by

no test coverage detected