summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-09-15 14:53:45 (GMT)
committerBrad King <brad.king@kitware.com>2021-09-15 17:19:37 (GMT)
commitf200f4d5a774ef83a938f0d99f80c2c8c83276b1 (patch)
tree91d976155878d3a9d29e72738c755febc99ee2ee /Source
parentd2a5fef985c03e347872d3b0bc7e9c311eac8fc5 (diff)
downloadCMake-f200f4d5a774ef83a938f0d99f80c2c8c83276b1.zip
CMake-f200f4d5a774ef83a938f0d99f80c2c8c83276b1.tar.gz
CMake-f200f4d5a774ef83a938f0d99f80c2c8c83276b1.tar.bz2
VS: Fix managed C++ project generation for VS 2022
VS 2022 expects managed `.vcxproj` files to have a `ManagedAssembly` element. Fixes: #22583
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index bda2f91..97cb1bf 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -581,6 +581,10 @@ void cmVisualStudio10TargetGenerator::Generate()
}
if (this->Managed) {
+ if (this->LocalGenerator->GetVersion() >=
+ cmGlobalVisualStudioGenerator::VS17) {
+ e1.Element("ManagedAssembly", "true");
+ }
std::string outputType;
switch (this->GeneratorTarget->GetType()) {
case cmStateEnums::OBJECT_LIBRARY: