geo icon indicating copy to clipboard operation
geo copied to clipboard

Enabling new proj features

Open urschrei opened this issue 4 years ago • 4 comments

As of 0.16.2, proj, has two optional, mutually-exclusive features:

  1. pkg_config, which runs pkg-config during the build phase in order to give the linker a better chance of finding libproj;
  2. bundled_proj, which builds libproj from a bundled source.

Both features are available for Linux and macOS targets. The simplest approach to including them is to add two new geo features which cover these, while retaining the "plain" use-proj feature. However, this feels like needless duplication, even though there's no way of passing on feature flags that I'm aware of.

urschrei avatar May 08 '20 13:05 urschrei

Do you mean something other than passing --features "proj proj/bundled_proj" / --features "proj proj/pkg_config"?

michaelkirk avatar Aug 17 '20 19:08 michaelkirk

Yes, because you can't specify those features in Cargo when specifying geo as a dependency and enabling proj (unless I'm misunderstanding you)

urschrei avatar Aug 17 '20 19:08 urschrei

oh you're right. I never realized you couldn't do something like:

[dependencies]
geo = { version = "*", features = ["proj", "proj/bundled_proj"] } # <-- doesn't work

From what I can tell, you're right, if we want to allow users the option to choose, we'd need to surface a feature for each set of flags, something like:

[features]
proj_bundled = ["proj", "proj/bundled_proj"]
proj_pkg_config = ["proj", "proj/pkg_config"]

michaelkirk avatar Aug 17 '20 20:08 michaelkirk

Good to close this? I feel like if people need specific features from proj we can discuss on a case-by-case basis

frewsxcv avatar Mar 21 '24 23:03 frewsxcv