Upload build.rs
Browse files
build.rs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fn main() {
|
| 2 |
+
// Only embed resources when the feature is enabled
|
| 3 |
+
if std::env::var("CARGO_FEATURE_EMBED_RESOURCES").is_ok() {
|
| 4 |
+
#[cfg(target_os = "windows")]
|
| 5 |
+
{
|
| 6 |
+
let mut res = winres::WindowsResource::new();
|
| 7 |
+
res.set_manifest_file("manifest.xml");
|
| 8 |
+
if let Err(e) = res.compile() {
|
| 9 |
+
eprintln!("Warning: Failed to embed manifest: {}", e);
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
}
|