-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support of vcpkg with msvc toolchain #79
base: main
Are you sure you want to change the base?
Conversation
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. |
bors try Sorry to let this sit for so long. Thanks for adding the ci integration, let's try it out. |
bors try |
tryAlready 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 |
tryBuild succeeded: |
build::link("ole32", true); | ||
let lib = vcpkg::Config::new() | ||
.emit_includes(true) | ||
.find_package("proj"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to constrain the version based on MINIMUM_PROJ_VERSION
like we do with pkg_config. Is that possible with vcpkg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I look you to check the version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't get the library version with vcpkg.
I can walk to library parents directory to read json file of the package if really needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the incredibly long delay (almost a year!).
The nightmare scenario is that someone has an old unsupported version of libproj and this library then gives them weird results because of it. On non-windows platforms we can enforce that this doesn't happen.
I'm not sure how likely this is in practice. Anybody else want to weigh in?
Using opus-rs as a starting point, I was able to compile proj Given these assumptions.. :
These commands should work fine. At least I was able to build my project on Windows :
(NOTE: I don't know whether or not this alone will result in linking with a release build of proj C++-library.) I'm just thinking that maybe instead of referring to vcpkg directly in build.rs and Cargo configurations, georust/proj could consider requiring I guess one advantage of this approach would be that it might not actually depend on vcpkg since developers can choose their own method for compiling proj C++-library (or so I believe). I hope this helps |
Hi @wlinna! To clarify — it sounds like you were able to build with the unmodified proj release using the instructions you provided. Is that right? Or did you have to modify the proj/proj-sys crate in some way? |
That's right, all unmodified :) . Rust, cargo are also installed with
default options. All I had to do was to install software and set env
variables according to the steps I provided.
…On Thursday, November 10, 2022, Michael Kirk ***@***.***> wrote:
Hi @wlinna <https://github.com/wlinna>! To clarify — it sounds like you
were able to build with the unmodified proj release using the instructions
you provided.
Is that right? Or did you have to modify the proj/proj-sys crate in some
way?
—
Reply to this email directly, view it on GitHub
<#79 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALHXLQZT7FROKWN3KATO4DWHPOW5ANCNFSM4YQYDIOQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This is amazing! Thanks for the hint about |
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:
To build, run
I'm new to rust, I hope this isn't to ugly in my implementation.