Crates.io | compile-time-run |
lib.rs | compile-time-run |
version | 0.2.12 |
source | src |
created_at | 2019-03-24 17:42:56.910617 |
updated_at | 2021-07-07 12:31:58.998333 |
description | run a command at compile time and capture the output |
homepage | |
repository | https://github.com/de-vri-es/rust-compile-time-run |
max_upload_size | |
id | 123526 |
size | 12,975 |
This crate contains macros to run commands on the host system at compile time. It can be used in some situations to take over functionaility that would otherwise have to be done using a build script.
An example:
use compile_time_run::{run_command, run_command_str};
const VALUE_STR : &'static str = run_command_str!("echo", "Hello World!");
const VALUE_BYTES : &'static [u8] = run_command!("echo", "Hello World!");
Keep in mind that running arbitrary commands during your build phase can easily hurt portability.