Android: Target API Level not set in Visual Studio
Hi CMake team!
I have created a very simple NDK project, and I want to build it using the android-24 API for armeabi-v7a and arm64-v8a
cmake -G "Visual Studio 16 2019" ^
-A ARM ^
--toolchain %ANDROID_NDK%\build\cmake\android.toolchain.cmake ^
-S . ^
-B armeabi-v7a ^
-DANDROID_ABI="armeabi-v7a" ^
-DANDROID_NATIVE_API_LEVEL="android-24" ^
-DANDROID_API="24"
cmake -G "Visual Studio 16 2019" ^
-A ARM64 ^
--toolchain %ANDROID_NDK%\build\cmake\android.toolchain.cmake ^
-S . ^
-B arm64-v8a ^
-DANDROID_ABI="arm64-v8a" ^
-DANDROID_NATIVE_API_LEVEL="android-24" ^
-DANDROID_API="24"
If you open both VS solutions, the Target API Level has not been set, which causes compilation/linking problems in projects that must use this API.
If you edit by hand Target API Level value, a new line appears in VisualStudio solution file, and now projects compile/link with the correct API.
Is there any way to modify Target API Level from CMake? It's a bug?
I attach a simple project for testing. Just run script.bat
inside dir.