summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-27 18:00:54 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-08-27 18:01:01 (GMT)
commitfa2ecf7fceacc135df5c898d70eeafdcc21afb19 (patch)
tree50bc0dadfa7927309afe9da0bdf1a032ab854621 /Source/cmVisualStudio10TargetGenerator.cxx
parent9903ec167795d35129c5656b89a56683e4c0fd60 (diff)
parente4ba1f5a94e25feb0b220637a34eea2e63000c54 (diff)
downloadCMake-fa2ecf7fceacc135df5c898d70eeafdcc21afb19.zip
CMake-fa2ecf7fceacc135df5c898d70eeafdcc21afb19.tar.gz
CMake-fa2ecf7fceacc135df5c898d70eeafdcc21afb19.tar.bz2
Merge topic 'ProjectReference'
e4ba1f5a94 VS: Disallow ReferenceOutputAssembly in ProjectReference if not possible Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2285
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx44
1 files changed, 21 insertions, 23 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index aa43457..4e15354 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3787,31 +3787,29 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
e2.Element("Project", "{" + this->GlobalGenerator->GetGUID(name) + "}");
e2.Element("Name", name);
this->WriteDotNetReferenceCustomTags(e2, name);
- if (this->Managed) {
- // If the dependency target is not managed (compiled with /clr or
- // C# target) 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;
- }
+
+ // If the dependency target is not managed (compiled with /clr or
+ // C# target) 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->HasLanguage("CSharp", "");
- }
- if (referenceNotManaged) {
- e2.Element("ReferenceOutputAssembly", "false");
- e2.Element("CopyToOutputDirectory", "Never");
- }
+ }
+ // Workaround for static library C# targets
+ if (referenceNotManaged && dt->GetType() == cmStateEnums::STATIC_LIBRARY) {
+ referenceNotManaged = !dt->HasLanguage("CSharp", "");
+ }
+ if (referenceNotManaged) {
+ e2.Element("ReferenceOutputAssembly", "false");
+ e2.Element("CopyToOutputDirectory", "Never");
}
}
}