Skip to content
Open
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- proj-sys-ubuntu
- proj-macos
- proj-sys-macos
- proj-windows
- proj-sys-ubuntu-asan
steps:
- name: Mark the job as a success
Expand All @@ -59,6 +60,7 @@ jobs:
- proj-sys-ubuntu
- proj-macos
- proj-sys-macos
- proj-windows
- proj-sys-ubuntu-asan
steps:
- name: Mark the job as a failure
Expand Down Expand Up @@ -205,6 +207,21 @@ jobs:
- run: brew install proj
- run: cargo test

proj-windows:
name: proj windows
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
# Currently, Windows build doesn't work without the bundled features.
features: ["--features bundled_proj_sqlite"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: choco install sqlite # Even if we bundle libsqlite, we still need the SQLite binary
- run: cargo build ${{ matrix.features }}
- run: cargo test ${{ matrix.features }}
# Build PROJ from the bundled source to enable ASAN. In order to link against
# the ASAN-enabled library, "-Z sanitizer=address" flag needs to be passed to
# the Rust compiler. So, this job requires the nightly toolchain.
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ members = ["proj-sys"]
[features]
default = ["geo-types"]
bundled_proj = [ "proj-sys/bundled_proj" ]
bundled_proj_sqlite = [ "proj-sys/bundled_proj_sqlite" ]
pkg_config = [ "proj-sys/pkg_config" ]
network = ["ureq", "http", "proj-sys/network"]

Expand Down
1 change: 1 addition & 0 deletions proj-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tar = "0.4.40"
[features]
nobuild = []
bundled_proj = []
bundled_proj_sqlite = ["bundled_proj", "libsqlite3-sys/bundled"]
# `pkg_config` feature is deprecated and does nothing
pkg_config = []
network = ["tiff"]
Expand Down
6 changes: 6 additions & 0 deletions proj-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
})?
};

// Link Windows system libs, which are used in cargo test
if cfg!(target_env = "msvc") {
println!("cargo:rustc-link-lib=ole32");
println!("cargo:rustc-link-lib=shell32");
}

#[cfg(feature = "buildtime_bindgen")]
generate_bindings(include_path)?;
#[cfg(not(feature = "buildtime_bindgen"))]
Expand Down
4 changes: 2 additions & 2 deletions src/proj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1779,8 +1779,8 @@ mod test {
let t = stereo70
.project(MyPoint::new(500119.70352012233, 500027.77896348457), true)
.unwrap();
assert_relative_eq!(t.x(), 0.43633200013698786);
assert_relative_eq!(t.y(), 0.8028510000110507);
assert_relative_eq!(t.x(), 0.436332000136988, epsilon = 1e-15);
assert_relative_eq!(t.y(), 0.802851000011051, epsilon = 1e-15);
}
#[test]
// Carry out an inverse projection to geodetic coordinates
Expand Down
Loading