-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild_main.rs
38 lines (29 loc) · 986 Bytes
/
build_main.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
#![allow(clippy::all)]
use crate::build_project::compile_mod::compile_mod;
use crate::build_project::compile_resource_pack::compile_resource_pack;
#[cfg(target_os = "windows")]
use winres::WindowsResource;
pub mod build_project {
pub mod compile_mod;
pub mod compile_resource_pack;
pub mod png_to_opa;
}
pub mod libraries {
pub mod events;
pub mod graphics;
}
pub mod shared;
fn main() {
#[cfg(target_os = "macos")]
println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path");
#[cfg(target_os = "linux")]
println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN");
#[cfg(target_os = "windows")]
{
WindowsResource::new().set_icon("resources/icon.ico").compile().unwrap();
}
// compile resource pack resources into Build/resources
compile_resource_pack(std::path::PathBuf::from("resources"), std::path::PathBuf::from("Build/Resources"));
// compile mod base_game
compile_mod(std::path::PathBuf::from("base_game"));
}