diff options
author | Brad King <brad.king@kitware.com> | 2019-09-26 14:43:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-09-26 14:43:27 (GMT) |
commit | b4087a23538f87efebcc8e4ece248416c242167f (patch) | |
tree | 14294890998c408da76c415d8fb6e6187cc3bf3a /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 28a2613dd291c641f17940e3f996bd4cc9b9888d (diff) | |
parent | 4dc8c153ec40c48f88e74beb127949395dfbcf55 (diff) | |
download | CMake-b4087a23538f87efebcc8e4ece248416c242167f.zip CMake-b4087a23538f87efebcc8e4ece248416c242167f.tar.gz CMake-b4087a23538f87efebcc8e4ece248416c242167f.tar.bz2 |
Merge topic 'vs-ReferenceOutputAssembly-conditions'
4dc8c153ec Tests: Teach VSWinStorePhone to verify the content of generated xap
481070a78a Tests: Teach VSWinStorePhone to verify the content of generated appx/msix
acdb326610 VS: Do not reference output assemblies of targets with no output
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3778
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index d28905a..176e790 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -4078,32 +4078,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0) e2.Element("Name", name); this->WriteDotNetReferenceCustomTags(e2, name); - // If the dependency target is not managed (compiled with /clr or - // C# target) and not a WinRT component we cannot reference it and - // have to set 'ReferenceOutputAssembly' to false. - auto referenceNotManaged = - dt->GetManagedType("") < cmGeneratorTarget::ManagedType::Mixed; - // Workaround to check for manually set /clr flags. - if (referenceNotManaged) { - if (const auto* flags = dt->GetProperty("COMPILE_OPTIONS")) { - std::string flagsStr = flags; - if (flagsStr.find("clr") != std::string::npos) { - // There is a warning already issued when building the flags. - referenceNotManaged = false; - } - } - } - // Workaround for static library C# targets - if (referenceNotManaged && dt->GetType() == cmStateEnums::STATIC_LIBRARY) { - referenceNotManaged = !dt->IsCSharpOnly(); - } - - // Referencing WinRT components is okay. - if (referenceNotManaged) { - referenceNotManaged = !dt->GetPropertyAsBool("VS_WINRT_COMPONENT"); - } - - if (referenceNotManaged) { + // Don't reference targets that don't produce any output. + if (dt->GetManagedType("") == cmGeneratorTarget::ManagedType::Undefined) { e2.Element("ReferenceOutputAssembly", "false"); e2.Element("CopyToOutputDirectory", "Never"); } |