@ 261027.7

261018.1 · 4caa87cda978f25211499266fcc99e637c582ebc

chore: update swc to v1.16.18

reading declarations

Changes to deps/swc/crates/swc_native_addon/build.rs. All files

deps/swc/crates/swc_native_addon/build.rs

new file mode 100644@@ -0,0 +1,38 @@+use std::{env, path::PathBuf, process::Command};++fn main() {+    println!("cargo:rerun-if-changed=src/cleanup/windows_helper.rs");+    if env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {+        return;+    }+    // Compile for the addon target, not the build-script host. The helper has+    // no external dependencies and is embedded in the carrier, so temporary+    // loading does not depend on a shell, Node executable, or installed tool.+    let output = PathBuf::from(env::var_os("OUT_DIR").unwrap()).join("cleanup.exe");+    let mut compiler = Command::new(env::var_os("RUSTC").unwrap());+    compiler.args([+        "src/cleanup/windows_helper.rs",+        "--edition=2021",+        "--crate-name=swc_native_cleanup",+        "-Copt-level=s",+        "-Cpanic=abort",+        "-Ctarget-feature=+crt-static",+        "-Clto",+        "-Ccodegen-units=1",+        "-Cstrip=symbols",+        "--target",+    ]);+    compiler+        .arg(env::var_os("TARGET").unwrap())+        .arg("-o")+        .arg(output);+    if let Some(linker) = env::var_os("RUSTC_LINKER") {+        let mut option = std::ffi::OsString::from("linker=");+        option.push(linker);+        compiler.arg("-C").arg(option);+    }+    assert!(+        compiler.status().unwrap().success(),+        "build native cleanup helper"+    );+}