summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-26 14:43:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-09-26 14:43:27 (GMT)
commitb4087a23538f87efebcc8e4ece248416c242167f (patch)
tree14294890998c408da76c415d8fb6e6187cc3bf3a /Source/cmVisualStudio10TargetGenerator.cxx
parent28a2613dd291c641f17940e3f996bd4cc9b9888d (diff)
parent4dc8c153ec40c48f88e74beb127949395dfbcf55 (diff)
downloadCMake-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.cxx28
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");
}