-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
25 lines (23 loc) · 964 Bytes
/
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
/// Converts string literal into a `LPCSTR`
/*macro_rules! l {
($str:literal) => {
concat!($str, "\0").as_ptr() as *const _
};
}
*/
fn main() {
// File alignment flags to reduce size of `.text` section.
println!("cargo:rustc-link-arg-bins=/ALIGN:128");
println!("cargo:rustc-link-arg-bins=/FILEALIGN:1");
// Merges empty `.rdata` and `.pdata` into .text section saving a few bytes in data
// directories portion of PE header.
println!("cargo:rustc-link-arg-bins=/MERGE:.rdata=.text");
println!("cargo:rustc-link-arg-bins=/MERGE:.pdata=.text");
// Prevents linking default C runtime libraries.
//println!("cargo:rustc-link-arg-bins=/NODEFAULTLIB");
// Removes `IMAGE_DEBUG_DIRECTORY` from PE.
println!("cargo:rustc-link-arg-bins=/EMITPOGOPHASEINFO");
println!("cargo:rustc-link-arg-bins=/DEBUG:NONE");
// See: https://github.com/mcountryman/min-sized-rust-windows/pull/7
println!("cargo:rustc-link-arg-bins=/STUB:stub.exe");
}