diff --git a/build/ninja_gen/src/render.rs b/build/ninja_gen/src/render.rs index a9a32cf84..4c83e382f 100644 --- a/build/ninja_gen/src/render.rs +++ b/build/ninja_gen/src/render.rs @@ -22,17 +22,12 @@ impl Build { ) .unwrap(); - writeln!(&mut buf, "builddir = {}", self.buildroot.as_str()).unwrap(); writeln!( &mut buf, "runner = $builddir/rust/release/{}", with_exe("runner") ) .unwrap(); - for (key, value) in &self.variables { - writeln!(&mut buf, "{} = {}", key, value).unwrap(); - } - buf.push('\n'); for (key, value) in &self.pools { writeln!(&mut buf, "pool {}\n depth = {}", key, value).unwrap(); @@ -54,6 +49,14 @@ impl Build { buf.push_str(&self.trailing_text); + buf = buf.replace("$builddir", self.buildroot.as_str()); + for (key, value) in &self.variables { + buf = buf.replace( + &format!("${key}"), + &value.replace("$builddir", self.buildroot.as_str()), + ); + } + buf } diff --git a/tools/install-n2 b/tools/install-n2 index d4ef988aa..a87017954 100755 --- a/tools/install-n2 +++ b/tools/install-n2 @@ -1,3 +1,3 @@ #!/bin/bash -cargo install --git https://github.com/ankitects/n2.git --rev 3eca2545a8f4c8cbdd8ed697936bd2ae929b55dd +cargo install --git https://github.com/ankitects/n2.git --rev 56202604d4c541524b82381162eafae4290fdd22