Add Luau version to `Artifacts` and env variable
This commit is contained in:
parent
e06294c4b0
commit
19d97491ab
|
@ -179,6 +179,15 @@ impl Artifacts {
|
|||
if let Some(ref cpp_stdlib) = self.cpp_stdlib {
|
||||
println!("cargo:rustc-link-lib={}", cpp_stdlib);
|
||||
}
|
||||
if let Some(version) = self.version() {
|
||||
println!("cargo:rustc-env=LUAU_VERSION={}", version);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn version(&self) -> Option<String> {
|
||||
let pkg_version = env!("CARGO_PKG_VERSION");
|
||||
let (_, luau_version) = pkg_version.split_once("+luau")?;
|
||||
Some(format!("0.{luau_version}"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue