| 2526 | } |
| 2527 | |
| 2528 | void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) |
| 2529 | { |
| 2530 | if (this->GeneratorTarget->GetType() == cmStateEnums::GLOBAL_TARGET) { |
| 2531 | return; |
| 2532 | } |
| 2533 | |
| 2534 | bool const haveUnityBuild = |
| 2535 | this->GeneratorTarget->GetPropertyAsBool("UNITY_BUILD"); |
| 2536 | |
| 2537 | if (haveUnityBuild && this->GlobalGenerator->GetSupportsUnityBuilds()) { |
| 2538 | Elem e1(e0, "PropertyGroup"); |
| 2539 | e1.Element("EnableUnitySupport", "true"); |
| 2540 | } |
| 2541 | |
| 2542 | Elem e1(e0, "ItemGroup"); |
| 2543 | e1.SetHasElements(); |
| 2544 | |
| 2545 | std::vector<size_t> all_configs; |
| 2546 | for (size_t ci = 0; ci < this->Configurations.size(); ++ci) { |
| 2547 | all_configs.push_back(ci); |
| 2548 | } |
| 2549 | |
| 2550 | std::vector<cmGeneratorTarget::AllConfigSource> const& sources = |
| 2551 | this->GeneratorTarget->GetAllConfigSources(); |
| 2552 | |
| 2553 | cmSourceFile const* srcCMakeLists = |
| 2554 | this->LocalGenerator->CreateVCProjBuildRule(); |
| 2555 | |
| 2556 | for (cmGeneratorTarget::AllConfigSource const& si : sources) { |
| 2557 | if (si.Source == srcCMakeLists) { |
| 2558 | // Skip explicit reference to CMakeLists.txt source. |
| 2559 | continue; |
| 2560 | } |
| 2561 | |
| 2562 | ConfigToSettings toolSettings; |
| 2563 | for (auto const& config : this->Configurations) { |
| 2564 | toolSettings[config]; |
| 2565 | } |
| 2566 | if (cmValue p = si.Source->GetProperty("VS_SETTINGS")) { |
| 2567 | ParseSettingsProperty(*p, toolSettings); |
| 2568 | } |
| 2569 | |
| 2570 | char const* tool = nullptr; |
| 2571 | cmValue const toolOverride = si.Source->GetProperty("VS_TOOL_OVERRIDE"); |
| 2572 | |
| 2573 | if (cmNonempty(toolOverride)) { |
| 2574 | // Custom tool specified: the file will be built in a user-defined way |
| 2575 | this->WriteExtraSource(e1, si.Source, toolSettings); |
| 2576 | } else { |
| 2577 | switch (si.Kind) { |
| 2578 | case cmGeneratorTarget::SourceKindAppManifest: |
| 2579 | tool = "AppxManifest"; |
| 2580 | break; |
| 2581 | case cmGeneratorTarget::SourceKindCertificate: |
| 2582 | tool = "None"; |
| 2583 | break; |
| 2584 | case cmGeneratorTarget::SourceKindCustomCommand: |
| 2585 | // Handled elsewhere. |
no test coverage detected