Skip to content

Commit

Permalink
Also link openssl on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Jun 8, 2024
1 parent 1bfca6b commit 8904805
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
- name: Test compile diesel
shell: bash
# currently broken as diesel does not allow pq-sys 0.5 yet
# allow to fail as diesel might not pull in the right feature yet
continue-on-error: true
run: |
cargo new test_diesel
Expand Down
4 changes: 2 additions & 2 deletions pq-src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ keywords = ["bindings", "libpq", "pq-sys", "bundled"]
categories = ["database", "external-ffi-bindings"]
readme = "README.md"

[target.'cfg(not(target_os = "windows"))'.dependencies]
openssl-sys = "0.9.93"
[dependencies]
openssl-sys = { version = "0.9.93", features = ["vendored"] }

[build-dependencies]
cc = "1.0.83"
Expand Down
18 changes: 6 additions & 12 deletions pq-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,14 @@ const LIBCOMMON_BASE: &[&str] = &[
"restricted_token.c",
"sprompt.c",
"logging.c",
];

const LIBCOMMON_NOT_WINDOWS: &[&str] = &[
"cryptohash_openssl.c",
"hmac_openssl.c",
"protocol_openssl.c",
];

const LIBCOMMON_WINDOWS: &[&str] = &[
"cryptohash.c",
"hmac.c",
"md5.c",
"sha1.c",
"sha2.c",
"wchar.c",
];
const LIBCOMMON_NOT_WINDOWS: &[&str] = &[];

const LIBCOMMON_WINDOWS: &[&str] = &["wchar.c"];

const LIBPQ_BASE: &[&str] = &[
"fe-auth-scram.c",
Expand All @@ -109,9 +101,11 @@ const LIBPQ_BASE: &[&str] = &[
"legacy-pqsignal.c",
"libpq-events.c",
"pqexpbuffer.c",
"fe-secure-common.c",
"fe-secure-openssl.c",
];

const LIBPQ_NOT_WINDOWS: &[&str] = &["fe-secure-common.c", "fe-secure-openssl.c"];
const LIBPQ_NOT_WINDOWS: &[&str] = &[];

const LIBPQ_WINDOWS: &[&str] = &["fe-secure.c", "pthread-win32.c", "win32.c"];

Expand Down
1 change: 0 additions & 1 deletion pq-src/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#[cfg(not(target_os = "windows"))]
extern crate openssl_sys;

0 comments on commit 8904805

Please sign in to comment.