1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00
Files
browser/apps/desktop/desktop_native/windows_plugin_authenticator/build.rs
Colton Hurst a42868a76d [PM-19253] Add Experimental WebAuthN Functions (#13860)
* PM-9126: Initial scaffolding for com object registration

* PM-9126: Clean Up PACOMObject trait and impl

* PM-9126: Add unsafe tests

* PM-9126: Clean up registration PR with a working CoRegisterClassObject call

* PM-9126: Add AddAuthenticator fn call

* PM-9126: Load AddAuthenticator fn call dynamically

* PM-9126: Add AddAuthenticator experiments

* PR-9126: add brackets around guids

* PM-9126: clean up part 1

* PM-9126: Cleanup changes

* Only call the register function if on Windows

* PM-9126: Block two generated types that create issues for the i686-pc-windows-msvc target

* PM-9126: Refine bindings file

* PM-19253: Add experimental WebAuthN functions

* PM-9126: Address PR comments part 1

* PM-9126: Address PR comments part 2

* PM-9126: Return result in napi layer

* PM-9126: Propogate error from add authenticator call

* PM-9126: Change for version update
2025-04-04 10:10:18 -04:00

28 lines
805 B
Rust

fn main() {
#[cfg(target_os = "windows")]
windows();
}
#[cfg(target_os = "windows")]
fn windows() {
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR not set");
let bindings = bindgen::Builder::default()
.header("pluginauthenticator.hpp")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.allowlist_type("DWORD")
.allowlist_type("PBYTE")
.allowlist_type("EXPERIMENTAL.*")
.allowlist_function(".*EXPERIMENTAL.*")
.allowlist_function("WebAuthNGetApiVersionNumber")
.generate()
.expect("Unable to generate bindings.");
bindings
.write_to_file(format!(
"{}\\windows_plugin_authenticator_bindings.rs",
out_dir
))
.expect("Couldn't write bindings.");
}