Skip to content

Commit 8851d0d

Browse files
authored
SQL-1296: Add the version informations to the Windows DLL (mongodb#103)
1 parent d89b3d8 commit 8851d0d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

odbc/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ thiserror = "1"
4444
[lib]
4545
name = "mongoodbc"
4646
crate-type = ["cdylib", "lib"]
47+
48+
[target.'cfg(windows)'.build-dependencies]
49+
winres = "0.1"

odbc/build.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#[cfg(windows)]
2+
extern crate winres;
3+
4+
#[cfg(windows)]
5+
fn main() {
6+
// the default for winres is to parse the version number from the neighboring Cargo.toml
7+
let mut res = winres::WindowsResource::new();
8+
res.set_version_info(winres::VersionInfo::FILETYPE, 2); // Dll file
9+
res.set("CompanyName", "MongoDB Inc.");
10+
11+
// compile will write the rc file, and enable the cargo linker to link the compiled resource file
12+
res.compile().unwrap();
13+
}
14+
15+
#[cfg(not(windows))]
16+
fn main() {}

0 commit comments

Comments
 (0)