Files
perlmod/perlmod-macro/build.rs
Wolfgang Bumiller 4632042632 perlmod, macro: detect perl's MULTIPLICITY flag
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-27 15:41:51 +02:00

16 lines
499 B
Rust

fn main() {
// get perl's MULTIPLICITY flag:
// perl -MConfig -e 'print $Config{usemultiplicity}'
let perl_multiplicity = std::process::Command::new("perl")
.arg("-MConfig")
.arg("-e")
.arg("print $Config{usemultiplicity}")
.output()
.expect("failed to get perl usemultiplicity flag");
// pass the multiplicity cfg flag:
if perl_multiplicity.stdout == b"define" {
println!("cargo:rustc-cfg=perlmod=\"multiplicity\"");
}
}