From 8d7ffed04819669ebc9fb365ade6bffaab443a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20St=C3=BCrmer?= Date: Fri, 27 Apr 2018 07:24:47 +0200 Subject: cmVisualStudio10TargetGenerator: issue warning when adding static C# lib --- Source/cmVisualStudio10TargetGenerator.cxx | 8 ++++++++ Tests/RunCMake/VS10Project/VsCSharpCustomTags-stderr.txt | 3 +++ Tests/RunCMake/VS10Project/VsCSharpReferenceProps-stderr.txt | 8 ++++++++ 3 files changed, 19 insertions(+) create mode 100644 Tests/RunCMake/VS10Project/VsCSharpCustomTags-stderr.txt create mode 100644 Tests/RunCMake/VS10Project/VsCSharpReferenceProps-stderr.txt 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.$ -- cgit v0.12