#run-command #run #command #build

macro build compile-time-run

run a command at compile time and capture the output

13 releases

0.2.12 Jul 7, 2021
0.2.11 Jul 16, 2020
0.2.8 Oct 17, 2019
0.2.6 Apr 15, 2019
0.1.0 Mar 24, 2019

#648 in Build Utils

Download history 2828/week @ 2024-03-14 3019/week @ 2024-03-21 3526/week @ 2024-03-28 3761/week @ 2024-04-04 3155/week @ 2024-04-11 2462/week @ 2024-04-18 1732/week @ 2024-04-25 2085/week @ 2024-05-02 2925/week @ 2024-05-09 2682/week @ 2024-05-16 2412/week @ 2024-05-23 2505/week @ 2024-05-30 2833/week @ 2024-06-06 2724/week @ 2024-06-13 2909/week @ 2024-06-20 2446/week @ 2024-06-27

11,342 downloads per month
Used in 2 crates

BSD-2-Clause

11KB
92 lines

Documentation crates.io Build Status

compile-time-run

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.


lib.rs:

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.

Dependencies

~1.5MB
~35K SLoC