#cargo-build #output #compilation #alert #display #message #debugging

macro no-std build build-alert

Display a message in the Cargo build output during compilation

7 releases

0.1.6 Jan 2, 2024
0.1.5 Dec 25, 2023
0.1.4 Jul 15, 2023
0.1.1 Mar 27, 2023

#443 in Build Utils

Download history 200/week @ 2024-08-13 205/week @ 2024-08-20 176/week @ 2024-08-27 179/week @ 2024-09-03 171/week @ 2024-09-10 163/week @ 2024-09-17 243/week @ 2024-09-24 220/week @ 2024-10-01 164/week @ 2024-10-08 354/week @ 2024-10-15 282/week @ 2024-10-22 287/week @ 2024-10-29 154/week @ 2024-11-05 146/week @ 2024-11-12 201/week @ 2024-11-19 260/week @ 2024-11-26

807 downloads per month
Used in 10 crates (8 directly)

MIT/Apache

9KB
74 lines

build-alert

github crates.io docs.rs build status

Display a message in the Cargo build output during compilation.

[dependencies]
build-alert = "0.1"

Example

#[cfg(debug_assertions)]
build_alert::yellow! {"
NOTE:  use --release
  Syn's test suite has some tests that run on every source file
  and test case in the rust-lang/rust repo, which can be pretty
  slow in debug mode. Consider running cargo test with `--release`
  to speed things up.
"}

#[cfg(not(feature = "all-features"))]
build_alert::red! {"
ERROR:  use --all-features
  Syn's test suite normally only works with all-features enabled.
  Run again with `--all-features`, or run with `--features test`
  to bypass this check.
"}

screenshot


License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.3–7MB
~50K SLoC