-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.rs
53 lines (48 loc) · 1.25 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#[cfg(target_os = "macos")]
fn os_specific() {
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.13");
}
#[cfg(target_os = "windows")]
fn os_specific() {
use std::path::PathBuf;
use std::process::Command;
// Create the wxs file listing everything in the mods directory.
let mut heat_path = PathBuf::from(
std::env::var("WIX")
.expect("Wix not installed. Please install at https://wixtoolset.org/"),
);
heat_path.push("bin");
heat_path.push("heat.exe");
Command::new(heat_path)
.args(&[
"dir",
"mods",
"-dr",
"MODS",
"-cg",
"ModsGroup",
"-gg",
"-ke",
"-sfrag",
"-srd",
"-platform",
"x64",
"-var",
"var.ModsSource",
"-template",
"fragment",
"-out",
"target/wix/mods.wxs",
])
.output()
.expect("failed to run heat to generate mods list");
// Add our icon to the exe.
let mut res = winres::WindowsResource::new();
res.set_icon("resources/icon.ico");
res.compile().unwrap();
}
#[cfg(target_os = "linux")]
fn os_specific() {}
fn main() {
os_specific();
}