diff options
author | Brad King <brad.king@kitware.com> | 2017-09-06 14:44:56 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-06 14:45:38 (GMT) |
commit | 70a2a5d1e05683c6be70bbedd6f9dd93556bd458 (patch) | |
tree | 0ca239bda59380b69ce90d55b605f28af5d0a012 /Source | |
parent | 8362db82ec442195bf361898655a683548a2f023 (diff) | |
parent | 94e70e5329e54754820008514a08614577d2f201 (diff) | |
download | CMake-70a2a5d1e05683c6be70bbedd6f9dd93556bd458.zip CMake-70a2a5d1e05683c6be70bbedd6f9dd93556bd458.tar.gz CMake-70a2a5d1e05683c6be70bbedd6f9dd93556bd458.tar.bz2 |
Merge topic 'vs-csharp-ref-no-asm'
94e70e53 Merge branch 'backport-vs-csharp-ref-no-asm' into vs-csharp-ref-no-asm
7e57e6ae VS: Do not reference output assemblies if not possible for CSharp target
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1203
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 7 |
3 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index d7ea35a..ece2a77 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -782,6 +782,19 @@ bool cmGlobalVisualStudioGenerator::TargetIsCSharpOnly( return false; } +bool cmGlobalVisualStudioGenerator::TargetCanBeReferenced( + cmGeneratorTarget const* gt) +{ + if (this->TargetIsCSharpOnly(gt)) { + 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 04d97c5..399b6e0 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -85,6 +85,9 @@ public: // return true if target is C# only static bool TargetIsCSharpOnly(cmGeneratorTarget const* 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 86099eb..7fe2f2a 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3607,6 +3607,13 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() this->WriteString("<Name>", 3); (*this->BuildFileStream) << name << "</Name>\n"; this->WriteDotNetReferenceCustomTags(name); + if (csproj == this->ProjectType) { + if (!static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator) + ->TargetCanBeReferenced(dt)) { + this->WriteString( + "<ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n", 3); + } + } this->WriteString("</ProjectReference>\n", 2); } this->WriteString("</ItemGroup>\n", 1); |