Pārlūkot izejas kodu

VS: Add AndroidAPILevel element to generated project files

Map `CMAKE_SYSTEM_VERSION` to the Android Target API Level for Visual
Studio projects.

Fixes: #22886
Benjamín de la Fuente Ranea 3 gadi atpakaļ
vecāks
revīzija
9d6a080421
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      Source/cmVisualStudio10TargetGenerator.cxx

+ 4 - 0
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)