Tests: Look for Visual Studio only on Windows hosts

Update logic added by commit 6051a49c78 (Visual Studio: Add Android
support, 2020-06-12, v3.19.0-rc1~619^2) to only look for VS
installations using `cmake_host_system_information` on Windows hosts.
Otherwise the `VS_*_DIR` keys are not available.

Fixes: #21547
This commit is contained in:
Brad King
2020-12-03 10:21:56 -05:00
parent 6cf88734a5
commit dca8800cb5

View File

@@ -206,7 +206,7 @@ if(BUILD_TESTING)
set(${reg} 0)
endif()
endforeach()
if(COMMAND cmake_host_system_information)
if(CMAKE_HOST_WIN32 AND COMMAND cmake_host_system_information)
set(info_vs15 "VS_15_DIR")
set(info_vs16 "VS_16_DIR")
set(vs_versions)