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
  • Loading branch information
ttencate committed Dec 15, 2022
1 parent 548cd33 commit 686273e
Show file tree
Hide file tree
Showing 3 changed files with 13,550 additions and 2 deletions.
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
5 changes: 3 additions & 2 deletions gdal-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ 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 686273e

Please sign in to comment.