Skip to content

Commit b823612

Browse files
committed
As cargo to add advapi32 to the linker
1 parent fd5ad4a commit b823612

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lmdb-master-sys/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ fn main() {
135135
.flag_if_supported("-Wbad-function-cast")
136136
.flag_if_supported("-Wuninitialized");
137137

138+
// On Windows, link explicitly advapi32 for security functions
139+
#[cfg(target_os = "windows")]
140+
println!("cargo:rustc-link-lib=advapi32");
141+
138142
if cfg!(feature = "posix-sem") {
139143
builder.define("MDB_USE_POSIX_SEM", None);
140144
}

lmdb-master3-sys/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ fn main() {
135135
.flag_if_supported("-Wbad-function-cast")
136136
.flag_if_supported("-Wuninitialized");
137137

138+
// On Windows, link explicitly advapi32 for security functions
139+
#[cfg(target_os = "windows")]
140+
println!("cargo:rustc-link-lib=advapi32");
141+
138142
if cfg!(feature = "posix-sem") {
139143
builder.define("MDB_USE_POSIX_SEM", None);
140144
}

0 commit comments

Comments
 (0)