Starting from MSVS 2017 v15.2, there is a tool coming along with the VS installer that gives the paths of various components. For example:
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find VC\Auxiliary\Build\vcvars64.bat
and the output (in stdout) will be a path to the vcvars64.bat
that sets all necessary variables in the current shell (including the path to cl
). After it is called, there is no need to set up anything manually in the environment. But I am not sure where is the best place to put it. Somewhere in the Makefile? Also this leaves several versions of VS (2015 and 2017 < v15.2) that probably could be used to build mediasoup’s worker, but lack the vswhere
tool. So there should be a check that it exists.