Skip to content

Commit

Permalink
Add prebuilt bindings for GDAL 3.6 and document how to do it
Browse files Browse the repository at this point in the history
Fixes #351
  • Loading branch information
ttencate committed Dec 15, 2022
1 parent 548cd33 commit 1f390ea
Show file tree
Hide file tree
Showing 4 changed files with 13,553 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

- <https://github.com/georust/gdal/pull/347>

- Added prebuilt bindings for GDAL 3.6 (released 6 November 2022).

## 0.14

- Added new content to `README.md` and the root docs.
Expand Down
9 changes: 9 additions & 0 deletions gdal-sys/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ attempt to use prebuilt bindings corresponding to that version. Alternatively,
you can generate your own bindings from your libgdal installation by specifying
the `bindgen` feature.

## Creating prebuilt bindings

If a new version of GDAL is released, you (as a `gdal` contributor) can
generate new bindings for inclusion in the `gdal-sys` source distribution by
building with the `bindgen` feature, and then copying the generated file. For
example (the hash will differ in your build):

$ cargo build --features bindgen
$ cp target/debug/build/gdal-sys-db833e3088b78e57/out/bindings.rs gdal-sys/prebuilt-bindings/gdal_3.6.rs
6 changes: 4 additions & 2 deletions gdal-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ pub fn write_bindings(include_paths: Vec<String>, out_path: &Path) {
.allowlist_function("VSI.*");

for path in include_paths {
builder = builder.clang_arg("-I");
builder = builder.clang_arg(path);
builder = builder
.clang_arg("-I")
.clang_arg(path)
.clang_arg("-fretain-comments-from-system-headers");
}

builder
Expand Down
Loading

0 comments on commit 1f390ea

Please sign in to comment.