项目文件夹

文件
2026-07-13 12:38:36 +08:00

29 行
965 B
Rust

extern crate napi_build;
fn main() {
static_vcruntime::metabuild();
napi_build::setup();
// Embed Windows resource metadata to establish binary legitimacy
// and reduce false positive detections from security software
#[cfg(windows)]
{
let mut res = winres::WindowsResource::new();
res.set("ProductName", "Nx")
.set(
"FileDescription",
"Nx Native Module - High-performance build system operations",
)
.set("CompanyName", "Nx")
.set("LegalCopyright", "Copyright (c) Nrwl. MIT License.")
.set("OriginalFilename", "nx.node")
.set("InternalName", "nx");
if let Err(e) = res.compile() {
// Don't fail the build if resource compilation fails
// (e.g., when cross-compiling from non-Windows)
eprintln!("cargo:warning=Failed to compile Windows resources: {}", e);
}
}
}