Skip to content

Commit

Permalink
Merge #80
Browse files Browse the repository at this point in the history
80: update bindgen to fix incorrect proj results on apple silicon r=lnicola a=michaelkirk

FIXES #52 


Co-authored-by: Michael Kirk <michael.code@endoftheworl.de>
  • Loading branch information
bors[bot] and michaelkirk authored Apr 19, 2021
2 parents 77ecb97 + ba3f12e commit 7c13100
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 20 deletions.
4 changes: 4 additions & 0 deletions proj-sys/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

- Update bindgen to fix proj-sys giving some incorrect results on Apple Silicon

# 0.19.0
- Update to PROJ 7.2.1

Expand Down
2 changes: 1 addition & 1 deletion proj-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ links = "proj"
[dependencies]

[build-dependencies]
bindgen = "0.56.0"
bindgen = "0.58.0"
pkg-config = "0.3.17"
cmake = "0.1"
flate2 = "1.0.14"
Expand Down
30 changes: 30 additions & 0 deletions proj-sys/MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Notes for maintainers

## Generating docs from bindings

Whenever updating libproj or bindgen you must regenerate the prebuilt bindings
at `proj-sys/src/bindings_docs-rs.rs`.

These prebuilt bindings are only used for generating documentation - e.g. on
https://docs.rs. Actual usage of the crate depends on dynamically built bindings, but
that entails having libproj installed or built from source, which we can't
expect docs.rs to do.

## To update the prebuilt bindings

Currently the process looks like:

```
cd proj-sys
cargo clean
cargo build
find ../target/proj-sys-* -name bindings_docs-rs.rs
```

copy that file over the `src/bindings_docs-rs.rs`, but retain the header:

```
/* THESE ARE NOT LIVE BINDINGS */
/* THEY EXIST FOR USE BY DOCS-RS ONLY */
```

2 changes: 1 addition & 1 deletion proj-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.clang_arg(format!("-I{}", include_path.to_string_lossy()))
.trust_clang_mangling(false)
.size_t_is_usize(true)
.blacklist_type("max_align_t")
.blocklist_type("max_align_t")
// The input header we would like to generate
// bindings for.
.header("wrapper.h")
Expand Down
Loading

0 comments on commit 7c13100

Please sign in to comment.