eclipse / paho.mqtt.rust

paho.mqtt.rust
Other
516 stars 102 forks source link

Upgrade cmake crate version to support Visual Studio 2022 #170

Closed Bktero closed 1 year ago

Bktero commented 1 year ago

Hi!

I am trying to use Paho MQTT but I have Visual Studio 2022 installed on my computer.

Cargo.toml from paho-mqtt-sys has cmake = { version = "=0.1.45", optional = true } as dependency.

Support for Visual Studio 2022 was added in CMake 3.21 and by this commit in cmake-rs 0.1.48.

As a consequence, when I try to cargo build my project, I get an error:

  thread 'main' panicked at 'Visual studio version detected but this crate doesn't know how to generate cmake files for it, can the `cmake` crate be updated?', C:\Users\z19100018\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:792:22

Can you upgrade the version of cmake-rs in the dependencies and release a new version of Paho MQTT please?

Best regards :) Bktero

thepperson commented 1 year ago

I am also running into this problem.

fpagliughi commented 1 year ago

Yeah, for context, we needed to pin the cmake crate at 0.1.45, due to an issue with the following version (0.1.46) which made it unusable with any cmake < v3.12.

See #137

It seems that the issue may be fixed with the v0.1.48 crate, but I don't even have an older version of CMake to test against on any of my development machines anymore! So I will hope for the best and update the dependency.

fpagliughi commented 1 year ago

BTW, this is a duplicate of #147

Bktero commented 1 year ago

Sorry for the duplicate.

Thanks for the fix :)

I read some comments in the code about instability with a higher version of CMake create. Indeed, dropping support for old versions can be a pain for people. However, CMake 3.12.0 was released in July 2018, so it may seem reasonable to drop support for older versions.