| 834 | } |
| 835 | |
| 836 | Json::Value CodemodelConfig::DumpDirectoryObject(Directory& d) |
| 837 | { |
| 838 | std::string prefix = "directory"; |
| 839 | std::string sourceDirRel = RelativeIfUnder( |
| 840 | this->TopSource, d.Snapshot.GetDirectory().GetCurrentSource()); |
| 841 | std::string buildDirRel = RelativeIfUnder( |
| 842 | this->TopBuild, d.Snapshot.GetDirectory().GetCurrentBinary()); |
| 843 | if (!cmSystemTools::FileIsFullPath(buildDirRel)) { |
| 844 | prefix = cmStrCat(prefix, '-', buildDirRel); |
| 845 | } else if (!cmSystemTools::FileIsFullPath(sourceDirRel)) { |
| 846 | prefix = cmStrCat(prefix, '-', sourceDirRel); |
| 847 | } |
| 848 | for (char& c : prefix) { |
| 849 | if (c == '/' || c == '\\') { |
| 850 | c = '.'; |
| 851 | } |
| 852 | } |
| 853 | if (!this->Config.empty()) { |
| 854 | prefix += "-" + this->Config; |
| 855 | } |
| 856 | |
| 857 | DirectoryObject dir(d.LocalGenerator, this->VersionMajor, this->VersionMinor, |
| 858 | this->Config, this->TargetIndexMap); |
| 859 | return this->FileAPI.MaybeJsonFile(dir.Dump(), prefix); |
| 860 | } |
| 861 | |
| 862 | Json::Value CodemodelConfig::DumpProjects() |
| 863 | { |
no test coverage detected