Android: Does not support `Visual Studio 17 2022` yet?
Issue
When using CMake to build for Android with the Visual Studio 17 2022
generator CmakeError.log
state:
"Determining the sysroot for the Android NDK failed."
The CMake generated output includes this as the symptom:
1> [CMake] CMake Error at CMakeProject1/CMakeLists.txt:10 (target_compile_features):
1> [CMake] target_compile_features no known features for CXX compiler
1> [CMake]
1> [CMake] ""
1> [CMake]
1> [CMake] version .
Diagnostics
Investigating this message takes you to the following check for Sysroot in Android-Determine.cmake
which has check for 14-16
i.e. 17
is not apparently included?
https://github.com/Kitware/CMake/blob/7936fc65dc75ac089e60b66bc28eb16ef64e534d/Modules/Platform/Android-Determine.cmake#L48
Reproducer
NOTE: Path to SDK/NDK may need adjusting respectively Android_CMake_VisualStudio17.zip CMakePreset:
{
"name": "android-msvc",
"generator": "Visual Studio 17 2022",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "arm64",
"strategy": "set"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_SYSTEM_NAME": "Android",
"CMAKE_SYSTEM_VERSION": "29",
"CMAKE_ANDROID_ARCH_ABI": "arm64-v8a",
"CMAKE_ANDROID_STL_TYPE": "c++_static",
"CMAKE_ANDROID_SDK": "C:/Microsoft/AndroidSDK/25",
"CMAKE_ANDROID_NDK": "C:/Microsoft/AndroidNDK/android-ndk-r21e"
},
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
},
Edited by Brad King