From 9d6a080421e19a896aebfa8fe68160b456ea61eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjam=C3=ADn=20de=20la=20Fuente=20Ranea?= Date: Wed, 8 Jun 2022 06:37:20 +0200 Subject: VS: Add AndroidAPILevel element to generated project files Map `CMAKE_SYSTEM_VERSION` to the Android Target API Level for Visual Studio projects. Fixes: #22886 --- Source/cmVisualStudio10TargetGenerator.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 60b89df..c79331c 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1639,6 +1639,10 @@ void cmVisualStudio10TargetGenerator::WriteAndroidConfigurationValues( e1.Element("UseOfStl", *stlType); } } + std::string const& apiLevel = gg->GetSystemVersion(); + if (!apiLevel.empty()) { + e1.Element("AndroidAPILevel", cmStrCat("android-", apiLevel)); + } } void cmVisualStudio10TargetGenerator::WriteCustomCommands(Elem& e0) -- cgit v0.12