Skip to content

Commit

Permalink
add cfg(feature = "frozen-abi") to build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Aug 5, 2024
1 parent 2316fea commit f0397d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frozen-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ solana-logger = { workspace = true }

[build-dependencies]
rustc_version = { workspace = true }

[features]
default = ["frozen-abi"]
# no reason to deactivate this. It's needed because the build.rs is reused elsewhere
frozen-abi = []
3 changes: 3 additions & 0 deletions frozen-abi/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#[cfg(feature = "frozen-abi")]
extern crate rustc_version;
#[cfg(feature = "frozen-abi")]
use rustc_version::{version_meta, Channel};

fn main() {
#[cfg(feature = "frozen-abi")]
// Copied and adapted from
// https://github.com/Kimundi/rustc-version-rs/blob/1d692a965f4e48a8cb72e82cda953107c0d22f47/README.md#example
// Licensed under Apache-2.0 + MIT
Expand Down
5 changes: 5 additions & 0 deletions frozen-abi/macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ syn = { workspace = true, features = ["full", "extra-traits"] }

[build-dependencies]
rustc_version = { workspace = true }

[features]
default = ["frozen-abi"]
# no reason to deactivate this. It's needed because the build.rs is reused elsewhere
frozen-abi = []

0 comments on commit f0397d3

Please sign in to comment.