cmVisualStudio10TargetGenerator: issue warning when adding static C# lib

This commit is contained in:
Michael Stürmer
2018-04-27 07:24:47 +02:00
parent 73ee599a82
commit 8d7ffed048
3 changed files with 19 additions and 0 deletions

View File

@@ -333,6 +333,14 @@ void cmVisualStudio10TargetGenerator::Generate()
this->ProjectType = vcxproj;
this->Managed = false;
} else if (this->ProjectFileExtension == ".csproj") {
if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
std::string message = "The C# target \"" +
this->GeneratorTarget->GetName() +
"\" is of type STATIC_LIBRARY. This is discouraged (and may be "
"disabled in future). Make it a SHARED library instead.";
this->Makefile->IssueMessage(cmake::MessageType::DEPRECATION_WARNING,
message);
}
this->ProjectType = csproj;
this->Managed = true;
}

View File

@@ -0,0 +1,3 @@
^CMake Deprecation Warning in CMakeLists.txt:
The C# target "foo" is of type STATIC_LIBRARY. This is discouraged \(and
may be disabled in future\). Make it a SHARED library instead.$

View File

@@ -0,0 +1,8 @@
^CMake Deprecation Warning in CMakeLists.txt:
The C# target "foo2" is of type STATIC_LIBRARY. This is discouraged \(and
may be disabled in future\). Make it a SHARED library instead.
CMake Deprecation Warning in CMakeLists.txt:
The C# target "foo" is of type STATIC_LIBRARY. This is discouraged \(and
may be disabled in future\). Make it a SHARED library instead.$