proj
proj copied to clipboard
add support of vcpkg with msvc toolchain
I added the support of vcpkg libraries in proj-sys. This allow to build proj-sys on windows with msvc without pkg-config.
To use vcpkg libraries on your rust program, you need:
- in .cargo/config file
[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = ["-Ctarget-feature=+crt-static"]
- in Cargo.toml file
[package.metadata.vcpkg]
git = "https://github.com/microsoft/vcpkg"
rev = "96a1f9c" # PROJ version 7.2.1 - https://github.com/microsoft/vcpkg/search?q=proj4&type=commits
install = ["proj:x64-windows-static"]
To build, run
cargo install cargo-vcpkg
cargo vcpkg build
cargo build
I'm new to rust, I hope this isn't to ugly in my implementation.
AFAIK none of the main contributors are using windows, so it'd be good to test this setup in CI.
Do you have any experience with using windows containers in GH actions? Would you be willing to add a job to https://github.com/georust/proj/blob/master/.github/workflows/test.yml?
Hi @lapoigne, apologies for the delay. As @michaelkirk says, we don't have anyone available to locally test this, but we're certainly interested in anything that improves the Windows experience for these crates.
I will look closer to add CI for windows platform.
I added windows in CI file. The 32bit platform is commented because we loose precision in floating number and the test fail. Maybe you just want remove this architecture. I edited some test because I get some insignificant change in some value like 1450880.2910605008 for 1450880.2910605003
bors try
Sorry to let this sit for so long. Thanks for adding the ci integration, let's try it out.
bors try
try
Already running a review
bors r-
bors retry
bors r+
one last try bors.
Bors is crashing, I'm going to follow up with some bors peeps.
update: done here https://forum.bors.tech/t/bors-crashing-resource-not-accessible-by-integration/571/3
update 2: looking into similarly errors reported, it seems like "editing the workflow file" is a common source of crashes between bors and gh