| 3059 | } |
| 3060 | |
| 3061 | cmSourceFile* cmMakefile::GetSource(std::string const& sourceName, |
| 3062 | cmSourceFileLocationKind kind) const |
| 3063 | { |
| 3064 | // First check "Known" paths (avoids the creation of cmSourceFileLocation) |
| 3065 | if (kind == cmSourceFileLocationKind::Known) { |
| 3066 | auto sfsi = this->KnownFileSearchIndex.find(sourceName); |
| 3067 | if (sfsi != this->KnownFileSearchIndex.end()) { |
| 3068 | return sfsi->second; |
| 3069 | } |
| 3070 | } |
| 3071 | |
| 3072 | cmSourceFileLocation sfl(this, sourceName, kind); |
| 3073 | auto name = this->GetCMakeInstance()->StripExtension(sfl.GetName()); |
| 3074 | #if defined(_WIN32) || defined(__APPLE__) |
| 3075 | name = cmSystemTools::LowerCase(name); |
| 3076 | #endif |
| 3077 | auto sfsi = this->SourceFileSearchIndex.find(name); |
| 3078 | if (sfsi != this->SourceFileSearchIndex.end()) { |
| 3079 | for (auto* sf : sfsi->second) { |
| 3080 | if (sf->Matches(sfl)) { |
| 3081 | return sf; |
| 3082 | } |
| 3083 | } |
| 3084 | } |
| 3085 | return nullptr; |
| 3086 | } |
| 3087 | |
| 3088 | cmSourceFile* cmMakefile::CreateSource(std::string const& sourceName, |
| 3089 | bool generated, |
no test coverage detected