#run-command #run #build #command

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

#154 in #run-command

Download history 3430/week @ 2024-07-23 3824/week @ 2024-07-30 3862/week @ 2024-08-06 3932/week @ 2024-08-13 3872/week @ 2024-08-20 3525/week @ 2024-08-27 4016/week @ 2024-09-03 3254/week @ 2024-09-10 3435/week @ 2024-09-17 2850/week @ 2024-09-24 3161/week @ 2024-10-01 2942/week @ 2024-10-08 3736/week @ 2024-10-15 3648/week @ 2024-10-22 3394/week @ 2024-10-29 3118/week @ 2024-11-05

14,336 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
~37K SLoC