KhronosGroup/Vulkan-LoaderAndValidationLayers

Error updating external sources if VS 2017 can't be located

gwihlidal opened this issue · 2 comments

update_external_sources.bat attempts to locate Visual Studio with some PATH checks in determine_vs_version.py, and this fails on machine with only VS 2017 installed:

PS H:\Repositories\Vulkan-LoaderAndValidationLayers> .\update_external_sources.bat
Determining VS version
Detected Visual Studio Version as 00 0000
Generating 64-bit Glslang CMake files for Visual Studio 00 0000 -DCMAKE_INSTALL_PREFIX=install ..
CMake Error: Could not create named generator Visual Studio 00 0000 Win64

However, running cmake directly from the same terminal, and specifying VS works fine:

PS H:\Repositories\Vulkan-LoaderAndValidationLayers\build> cmake -G "Visual Studio 15 2017 Win64" ..
-- The C compiler identification is MSVC 19.12.25835.0
-- The CXX compiler identification is MSVC 19.12.25835.0

It seems like the VS locator should either be replaced with relying on cmake itself to find Visual Studio, or use vswhere (https://github.com/Microsoft/vswhere). Alternatively, fall back to these if methods if the script doesn't find VS.

The build instructions do say Open a Developer Command Prompt for VS201x, but it would be nicer to not have this requirement, as cmake itself doesn't require this.

These are great suggestions -- I've never been a fan of that script though I think it might have at least one side-purpose. Either way, it's possible we could deprecate it or at least avoid using it for the main build. This is great timing, the repo structure and CMake files are getting a thorough scrub and cleanup. Thanks!

Oh yes, +1 to this. Every time I have to build the layers from a freshly checked out repo, this one incites a heavy sigh in my cubicle.