| 232 | } |
| 233 | |
| 234 | std::vector<BT<std::string>> cmGeneratorTarget::GetSourceFilePaths( |
| 235 | std::string const& config) const |
| 236 | { |
| 237 | std::vector<BT<std::string>> files; |
| 238 | |
| 239 | cmList debugProperties{ this->Makefile->GetDefinition( |
| 240 | "CMAKE_DEBUG_TARGET_PROPERTIES") }; |
| 241 | bool debugSources = |
| 242 | !this->DebugSourcesDone && cm::contains(debugProperties, "SOURCES"); |
| 243 | |
| 244 | this->DebugSourcesDone = true; |
| 245 | |
| 246 | cm::GenEx::Context context(this->LocalGenerator, config, |
| 247 | /*language=*/std::string()); |
| 248 | |
| 249 | cmGeneratorExpressionDAGChecker dagChecker{ |
| 250 | this, "SOURCES", nullptr, nullptr, context, |
| 251 | }; |
| 252 | |
| 253 | EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries( |
| 254 | this, context, &dagChecker, this->SourceEntries); |
| 255 | |
| 256 | std::unordered_set<std::string> uniqueSrcs; |
| 257 | bool contextDependentDirectSources = |
| 258 | processSources(this, entries, files, uniqueSrcs, debugSources); |
| 259 | |
| 260 | // Collect INTERFACE_SOURCES of all direct link-dependencies. |
| 261 | EvaluatedTargetPropertyEntries linkInterfaceSourcesEntries; |
| 262 | AddInterfaceEntries(this, "INTERFACE_SOURCES", context, &dagChecker, |
| 263 | linkInterfaceSourcesEntries, IncludeRuntimeInterface::No, |
| 264 | UseTo::Compile); |
| 265 | bool contextDependentInterfaceSources = processSources( |
| 266 | this, linkInterfaceSourcesEntries, files, uniqueSrcs, debugSources); |
| 267 | |
| 268 | // Collect TARGET_OBJECTS of direct object link-dependencies. |
| 269 | bool contextDependentObjects = false; |
| 270 | if (this->GetType() != cmStateEnums::OBJECT_LIBRARY) { |
| 271 | EvaluatedTargetPropertyEntries linkObjectsEntries; |
| 272 | AddObjectEntries(this, context, &dagChecker, linkObjectsEntries); |
| 273 | contextDependentObjects = processSources(this, linkObjectsEntries, files, |
| 274 | uniqueSrcs, debugSources); |
| 275 | // Note that for imported targets or multi-config generators supporting |
| 276 | // cross-config builds the paths to the object files must be per-config, |
| 277 | // so contextDependentObjects will be true here even if object libraries |
| 278 | // are specified without per-config generator expressions. |
| 279 | } |
| 280 | |
| 281 | // Collect this target's file sets. |
| 282 | EvaluatedTargetPropertyEntries fileSetEntries; |
| 283 | AddFileSetEntries(this, context, &dagChecker, fileSetEntries); |
| 284 | bool contextDependentFileSets = |
| 285 | processSources(this, fileSetEntries, files, uniqueSrcs, debugSources); |
| 286 | |
| 287 | // Determine if sources are context-dependent or not. |
| 288 | if (!contextDependentDirectSources && !contextDependentInterfaceSources && |
| 289 | !contextDependentObjects && !contextDependentFileSets) { |
| 290 | this->SourcesAreContextDependent = Tribool::False; |
| 291 | } else { |
no test coverage detected