Skip to content

Commit 30f00a5

Browse files
authored
Merge pull request #28 from aya-rs/fix-build-1.79-nightly
Fix build in rust 1.79
2 parents d662d4c + 418d60c commit 30f00a5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aya-rustc-llvm-proxy"
3-
version = "0.9.1"
3+
version = "0.9.2"
44
authors = ["Alessandro Decina <[email protected]>"]
55
description = "Dynamically proxy LLVM calls into Rust own shared library"
66
license = "MIT"
@@ -24,4 +24,5 @@ anyhow = "1.0.72"
2424
cargo_metadata = "0.18.0"
2525
prettyplease = "0.2.10"
2626
quote = "1.0.29"
27+
rustversion = "1.0"
2728
syn = { version = "2.0.26", features = ["full"] }

build.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ mod llvm {
5959

6060
impl Generator {
6161
pub fn parse_llvm_sys_crate(&mut self) -> Result<&mut Self, Error> {
62+
// See https://github.com/rust-lang/cargo/pull/12783.
63+
64+
#[rustversion::before(1.79)]
65+
const LLVM_SYS_CRATE_TARGET: &str = "llvm-sys";
66+
67+
#[rustversion::since(1.79)]
68+
const LLVM_SYS_CRATE_TARGET: &str = "llvm_sys";
69+
6270
let metadata = MetadataCommand::new()
6371
.exec()
6472
.context("Unable to get crate metadata")?;
@@ -72,7 +80,7 @@ mod llvm {
7280
targets
7381
.into_iter()
7482
.find_map(|Target { name, src_path, .. }| {
75-
(name == "llvm-sys").then_some(src_path)
83+
(name == LLVM_SYS_CRATE_TARGET).then_some(src_path)
7684
})
7785
})
7886
.flatten()

0 commit comments

Comments
 (0)