From 663f5120f4e20ec716c742fea1d35cced3e3871f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20St=C3=BCrmer?= Date: Thu, 22 Mar 2018 17:09:43 +0100 Subject: cmGlobalVisualStudioGenerator: remove TargetCanBeReferenced() --- Source/cmGlobalVisualStudioGenerator.cxx | 13 ------------- Source/cmGlobalVisualStudioGenerator.h | 3 --- Source/cmVisualStudio10TargetGenerator.cxx | 5 ++++- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index a0e5d06..1175acf 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -734,19 +734,6 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly( return false; } -bool cmGlobalVisualStudioGenerator::TargetCanBeReferenced( - cmGeneratorTarget const* gt) -{ - if (gt->GetManagedType("") != cmGeneratorTarget::ManagedType::Native) { - return true; - } - if (gt->GetType() != cmStateEnums::SHARED_LIBRARY && - gt->GetType() != cmStateEnums::EXECUTABLE) { - return false; - } - return true; -} - bool cmGlobalVisualStudioGenerator::TargetCompare::operator()( cmGeneratorTarget const* l, cmGeneratorTarget const* r) const { diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index da1f9a4..07bc9a3 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -81,9 +81,6 @@ public: // return true if target is fortran only bool TargetIsFortranOnly(const cmGeneratorTarget* gt); - // return true if target can be referenced by C# targets - bool TargetCanBeReferenced(cmGeneratorTarget const* gt); - /** Get the top-level registry key for this VS version. */ std::string GetRegistryBase(); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 351f530..269bc11 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3773,7 +3773,10 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() "{" + this->GlobalGenerator->GetGUID(name) + "}", 3); this->WriteElem("Name", name, 3); this->WriteDotNetReferenceCustomTags(name); - if (!this->GlobalGenerator->TargetCanBeReferenced(dt)) { + // If the target is not compiled with any /clr flag, there is + // no assembly to reference. + if (this->Managed && + dt->GetManagedType("") < cmGeneratorTarget::ManagedType::Mixed) { this->WriteElem("ReferenceOutputAssembly", "false", 3); } this->WriteString("\n", 2); -- cgit v0.12