mirror of
https://github.com/reactos/CMake.git
synced 2025-02-23 13:32:49 +00:00
Merge topic 'ProjectReference'
e4ba1f5a94 VS: Disallow ReferenceOutputAssembly in ProjectReference if not possible Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2285
This commit is contained in:
commit
fa2ecf7fce
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user