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

Method DumpSource

Source/cmFileAPICodemodel.cxx:1813–1861  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1811}
1812
1813Json::Value Target::DumpSource(cmGeneratorTarget::SourceAndKind const& sk,
1814 Json::ArrayIndex si,
1815 FileSetDatabase const& fsdb)
1816{
1817 Json::Value source = Json::objectValue;
1818
1819 cmSourceFile* sf = sk.Source.Value;
1820 std::string const path = sf->ResolveFullPath();
1821 source["path"] = RelativeIfUnder(this->TopSource, path);
1822 if (sk.Source.Value->GetIsGenerated()) {
1823 source["isGenerated"] = true;
1824 }
1825 this->AddBacktrace(source, sk.Source.Backtrace);
1826
1827 auto fsit = fsdb.find(path);
1828 if (fsit != fsdb.end()) {
1829 source["fileSetIndex"] = fsit->second;
1830 }
1831
1832 if (cmSourceGroup const* sg =
1833 this->GT->LocalGenerator->FindSourceGroup(path)) {
1834 Json::ArrayIndex const groupIndex = this->AddSourceGroup(sg);
1835 source["sourceGroupIndex"] = groupIndex;
1836 this->SourceGroups[groupIndex].SourceIndexes.append(si);
1837 }
1838
1839 switch (sk.Kind) {
1840 case cmGeneratorTarget::SourceKindCxxModuleSource:
1841 case cmGeneratorTarget::SourceKindObjectSource: {
1842 source["compileGroupIndex"] =
1843 this->AddSourceCompileGroup(sk.Source.Value, si);
1844 } break;
1845 case cmGeneratorTarget::SourceKindAppManifest:
1846 case cmGeneratorTarget::SourceKindCertificate:
1847 case cmGeneratorTarget::SourceKindCustomCommand:
1848 case cmGeneratorTarget::SourceKindExternalObject:
1849 case cmGeneratorTarget::SourceKindExtra:
1850 case cmGeneratorTarget::SourceKindHeader:
1851 case cmGeneratorTarget::SourceKindIDL:
1852 case cmGeneratorTarget::SourceKindManifest:
1853 case cmGeneratorTarget::SourceKindModuleDefinition:
1854 case cmGeneratorTarget::SourceKindResx:
1855 case cmGeneratorTarget::SourceKindXaml:
1856 case cmGeneratorTarget::SourceKindUnityBatched:
1857 break;
1858 }
1859
1860 return source;
1861}
1862
1863Json::Value Target::DumpInterfaceSources(FileSetDatabase const& fsdb)
1864{

Callers 1

DumpSourcesMethod · 0.95

Calls 9

AddSourceGroupMethod · 0.95
AddSourceCompileGroupMethod · 0.95
RelativeIfUnderFunction · 0.85
GetIsGeneratedMethod · 0.80
AddBacktraceMethod · 0.80
appendMethod · 0.80
findMethod · 0.45
endMethod · 0.45
FindSourceGroupMethod · 0.45

Tested by

no test coverage detected