mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-01 01:29:02 +08:00
2bb1310094
Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
36 lines
995 B
Rust
36 lines
995 B
Rust
#[cfg(target_os = "windows")]
|
|
fn build_c_impl() {
|
|
let mut build = cc::Build::new();
|
|
|
|
build.file("src/windows/wf_cliprdr.c");
|
|
|
|
{
|
|
build.flag_if_supported("-Wno-c++0x-extensions");
|
|
build.flag_if_supported("-Wno-return-type-c-linkage");
|
|
build.flag_if_supported("-Wno-invalid-offsetof");
|
|
build.flag_if_supported("-Wno-unused-parameter");
|
|
|
|
if build.get_compiler().is_like_msvc() {
|
|
build.define("WIN32", "");
|
|
// build.define("_AMD64_", "");
|
|
build.flag("-Z7");
|
|
build.flag("-GR-");
|
|
// build.flag("-std:c++11");
|
|
} else {
|
|
build.flag("-fPIC");
|
|
// build.flag("-std=c++11");
|
|
// build.flag("-include");
|
|
// build.flag(&confdefs_path.to_string_lossy());
|
|
}
|
|
|
|
build.compile("mycliprdr");
|
|
}
|
|
|
|
println!("cargo:rerun-if-changed=src/windows/wf_cliprdr.c");
|
|
}
|
|
|
|
fn main() {
|
|
#[cfg(target_os = "windows")]
|
|
build_c_impl();
|
|
}
|