diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2018-04-27 05:24:47 (GMT) |
---|---|---|
committer | Michael Stürmer <michael.stuermer@schaeffler.com> | 2018-05-07 05:20:46 (GMT) |
commit | 8d7ffed04819669ebc9fb365ade6bffaab443a3a (patch) | |
tree | be17f5a635597f3b42f4b225cd6a77c76cb41f22 | |
parent | 73ee599a8203271245ab7a55095eb92843768b54 (diff) | |
download | CMake-8d7ffed04819669ebc9fb365ade6bffaab443a3a.zip CMake-8d7ffed04819669ebc9fb365ade6bffaab443a3a.tar.gz CMake-8d7ffed04819669ebc9fb365ade6bffaab443a3a.tar.bz2 |
cmVisualStudio10TargetGenerator: issue warning when adding static C# lib
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 8 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsCSharpCustomTags-stderr.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsCSharpReferenceProps-stderr.txt | 8 |
3 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 7a7c647..da00f5c 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -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; } diff --git a/Tests/RunCMake/VS10Project/VsCSharpCustomTags-stderr.txt b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-stderr.txt new file mode 100644 index 0000000..1ea3b51 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-stderr.txt @@ -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.$ diff --git a/Tests/RunCMake/VS10Project/VsCSharpReferenceProps-stderr.txt b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps-stderr.txt new file mode 100644 index 0000000..4402b8f --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps-stderr.txt @@ -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.$ |