(zilch lang rust): add CARGO_TARGET_DIR

This commit is contained in:
puck 2025-03-02 14:05:26 +00:00
parent 063550ca00
commit de31b96fc8
2 changed files with 9 additions and 1 deletions

View file

@ -40,9 +40,16 @@ fn parse(data: &str) -> HashMap<String, String> {
fn main() {
create_dir(var_os("OUT_DIR").unwrap()).unwrap();
create_dir(var_os("CARGO_TARGET_DIR").unwrap()).unwrap();
let mut f = File::create(var_os("out").unwrap()).unwrap();
writeln!(&mut f, "zilch: OUT_DIR={:?}", var("OUT_DIR").unwrap()).unwrap();
writeln!(
&mut f,
"zilch: CARGO_TARGET_DIR={:?}",
var("CARGO_TARGET_DIR").unwrap()
)
.unwrap();
let mut cmd = Command::new(var_os("script").unwrap());

View file

@ -33,7 +33,8 @@
#~(("script" . #$input-script)
("cwd" . #$cwd)
("OUT_DIR" . ,(make-placeholder "outdir"))
("CARGO_TARGET_DIR" . ,(make-placeholder "targetdir"))
. #$env)
'("out" "outdir")))
'("out" "outdir" "targetdir")))
(values (cdr (assoc "outdir" output)) (cdr (assoc "out" output))))))