ssalonen / libcec-sys

FFI bindings for the libcec
GNU General Public License v2.0
2 stars 3 forks source link

Handle unsupported visual studio version gracefully #26

Open ssalonen opened 2 years ago

ssalonen commented 2 years ago

There is also no easy way to find installed Visual Studio versions. cc seems capable of this, but it only exposes a method for getting the latest installed version (if they have 2022 then we can't know if they have 2019), check here.

An alternative would be to use the vswhere utility, which comes preinstalled with Visual Studio 2017+. Since libcec theoretically supports down to 2013, we would have to manually download the executable. In addition, we would have to pull in this dependency, which unfortunately hasn't been maintained in over 4 years. I'm not sure if there is anything else.

Edit: Although libcec seems to compile fine with 2017, the docs state it only supports 2019+ so there could possibly be side effects. We should probably only support 2019 and if it's not installed, libcec will automatically output a corresponding error.

Originally posted by @ok-nick in https://github.com/ssalonen/libcec-sys/pull/15#issuecomment-1196140482

Potentially useful https://github.com/Pulse-Eight/libcec-support/blob/master/windows/config/toolchain.cmd

ssalonen commented 2 years ago

Additional comment from @ok-nick

libcec does not compile with Visual Studio 2022. It does compile with 2017-2019 (as far as I've tested) although the docs state it only supports 2019+. I will make it so you must have 2019 installed.

ok-nick commented 2 years ago

The toolchain.cmd file you linked is why I assumed libcec supports >2013.